[comp.windows.x] Text Background

dbb@cerc.wvu.wvnet.edu (Dice Blackboard) (07/03/89)

After the XtRealizeWidget invocation, We are trying to set the 
text widget background using :

    XtSetArg(arg[0], XtNbackground, 1);
    XtSetValues(widget_id, arg, 1);

It does not seem to work.

Any ideas ?

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (07/06/89)

> After the XtRealizeWidget invocation, We are trying to set the 
> text widget background using :

>     XtSetArg(arg[0], XtNbackground, 1);
>     XtSetValues(widget_id, arg, 1);

> It does not seem to work.

What does setting the background pixel to 1 mean?  Are you sure that it
is not currently set to 1, and that 1 corresponds to a valid pixel?  I have
used code like the following and it seems to work for me.


#include <X11/Cardinals.h>

	XtSetArg(args[0], XtNBackground, WhitePixelOfScreen(XtScreen(w)));
	XtSetValues(w, args, ONE);

or

	XtSetArg(args[0], XtNBackground, BlackPixelOfScreen(XtScreen(w)));
	XtSetValues(w, args, ONE);

						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213

swick@ATHENA.MIT.EDU (Ralph R. Swick) (07/07/89)

     Date:  3 Jul 89 14:56:29 GMT
     From:  uflorida!haven!h.cs.wvu.wvnet.edu!cerc.wvu.wvnet.edu!dbb@gatech.edu
      (Dice Blackboard)

     After the XtRealizeWidget invocation, We are trying to set the 
     text widget background using :

         XtSetArg(arg[0], XtNbackground, 1);
         XtSetValues(widget_id, arg, 1);

     It does not seem to work.

     Any ideas ?

If you're using the Xaw Text widget, it's broken.  Most things that
you'd like to change with XtSetValues can't be changed.  Improvements
are planned...