[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

3155.0. "Help for inverting colors in Label widgets..." by MLNAD0::POGLIANI (Ducunt fata volentem, nolentem trahunt) Wed Aug 01 1990 07:45

T.RTitleUserPersonal
Name
DateLines
3155.1GetValues, the SetValue or CreateR2ME2::OBRYANWed Aug 01 1990 15:3938
RE:.0

>I would like to create another Label Widget but "in reverse"

How about something like this:
Get the foreground & background of the existing label widget, then use these
values to SetValue or Create the New label widget.

XColor   *a_foreground;	XColor   *a_background;
Arg r_args[2];


...
    XtSetArg(arg[0], DwtNforeground, &a_foreground );
    XtSetArg(arg[1], DwtNbackground, &a_background );
    XtGetValues( existing_label_widget, r_args, 2);

    XtSetArg(arg[0], DwtNforeground, a_background );
    XtSetArg(arg[1], DwtNbackground, a_foreground );

then either:

	XtSetValues( new_label_widget, r_args, 2);
OR

	DwtFetchWidgetOverride(ar_UIHierarchy,
		"fetched_label_name",
		ar_parent_widget,  NULL,
		r_args, 2,
		&new_label_widget,
		&a_dummy_class )
OR

	DwtLabelCreate(...,r_args,2)


Michael
3155.2BBOOP::SCAERWed Aug 01 1990 17:115
	Also, make sure that your label is
	a widget and not a gadget because
	foreground and background colors cannot
	be changed on a gadget.