| 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 |
Hi everybody,
I'm just a very new one in the DECW Programming.
I'm trying to do a simple thing:
I display a Label Widget (created and managed in C). It is created
using the default colors.
Then, always in C, I would like to create another Label Widget but "in
reverse", that means that I would like the foreground to become the
background and viceversa.
I tried declaring the following
Screen *screen = XtScreen(top_level);
Display *display = DisplayOfScreen(screen);
and then using the XtGetArg with the DwtNforeground and
DwtNbackground qualifiers I thought I really had the foreground and
background colors (declared as Pixel).
So, I tried to use the xtSetArg JUST inverting the fore/background
stuffs.
BUT IT DID NOT WORK. The only result I have is that both the back and
fore are BLACK and I do not see my label any more.
Could someone help me just providing a simple 20 lines of code that
performs this stupid task ?
Thanks a lot !
/�og
| T.R | Title | User | Personal Name | Date | Lines |
|---|---|---|---|---|---|
| 3155.1 | GetValues, the SetValue or Create | R2ME2::OBRYAN | Wed Aug 01 1990 11:39 | 38 | |
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.2 | BBOOP::SCAER | Wed Aug 01 1990 13:11 | 5 | ||
Also, make sure that your label is a widget and not a gadget because foreground and background colors cannot be changed on a gadget. | |||||