[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

2446.0. "Foreground and Background colors??" by KAOU35::DLEROUX () Wed Mar 14 1990 14:03

    
    After the discussion in note 2418, I decided to implement my multiple
    display application in black&white.  I am now trying to change all the
    background and foreground colors.
    
    I ran into a small problem trying to specify black & white foregrounds
    and backgrounds for some widgets.
    
    i) a file selection widget:  the background attribute can be set but
    that does not affect its children.
    
    ii) a selection widget: same as file selection widget.
                                                
    What I need is a way to change the background and foreground colors for
    a widget so that it also affects all of its children.
    
    Also, is there a way to change the color of the title bar of a topLevel 
    or popup widget?
    
    Dan
    
T.RTitleUserPersonal
Name
DateLines
2446.1Just a thought...GSRC::WESTVariables don't, Constants aren'tWed Mar 14 1990 21:3116
  If you want a consistent color scheme, i.e. all backgrounds black and all
foregrounds white, then you could do something that I've done to solve a
situation like this.

  Create/Replace the ResourceManager atom on the root window with the
following resources:

	*Background: Black
	*Foreground: White

  These will in a sense become the default colors for the widgets.  This
worked for me and I can not be sure that this will work for all widgets.
Maybe someone can elaborate on this.

					-=> Jim <=-
2446.2How...KAOU35::DLEROUXThu Mar 15 1990 11:2817
    
    > Create/Replace the ResourceManager atom ... 
                                                       
    How do I do this?  I have never tried to change resources before and it
    isn't very well documented. 
    
    Here's what I tried :
    
    char *property_data[] = { "*Background: White", "*Foreground: Black" };
    
    XChangeProperty( conn[0].display, XRootWindow( display,
                                      XDefaultScreen( display ) ),
                     XA_RESOURCE_MANAGER, XA_RESOURCE_MANAGER, 16,
                     PropModeReplace, property_data, 2 );
    
    I do this after my call to XtInitialize.
    
2446.3Ignore ...KAOU35::DLEROUXThu Mar 15 1990 11:376
    
    Ignore my last request.  I got it working.
    
    Thanks,
    Dan
    
2446.4TRNSAM::HOLTRobert Holt, ISV Atelier WestThu Mar 15 1990 17:194
    
    so, what worked?
    
    
2446.5AITG::DERAMODan D&#039;Eramo, nice personThu Mar 15 1990 18:375
        This doesn't strike me as very polite, unless after
        creating your widget hierarchy you restore the former
        value of the property.
        
        Dan
2446.6...GSRC::WESTVariables don&#039;t, Constants aren&#039;tThu Mar 15 1990 23:2621
RE: .5
  True...In my case we have a single environment and needed to control it
globally.  To be (as close to as possible) a good client :^)  you should
first retrieve and store the original property.

RE: .? (Can't remember now...must be old age)

  The reason his first call didn't work and how he (just guessing) got it
to work was that two of the parameters were in error.

  The format supplied was 16 when it should have been 8 since we are dealing
with string (character) data, so only 8 bits is needed.  The other parameter
is NumElements.  The value 2 was supplied when the actual value is the number
of characters in the resource.  For instance, if the resource is

	"*Background: Black"

then NumElements should be 18.

					-=> Jim <=-

2446.7What I did ...KAOU35::DLEROUXFri Mar 16 1990 08:3824
    
    re 5.
    	True... 
    	I won't use this method for several reasons.  First, it has
    	unpredictable results on the other displays. Second, as you mentioned
    	it is not very polite.
        It also turns out that I no longer need to do this since the "bug"
    	or "missing feature" which required this workaround is fixed in
    	5.4-EFT.
    
    re 4.
    
    	Here's my code :
    
        char *property_data[] = { "*Background: White\n",
                                  "*Foreground: Black\n" };
                             
    	XChangeProperty( display, XRootWindow( display,
                                        XDefaultScreen( display ) ),   
                         XA_RESOURCE_MANAGER, XA_STRING, 16,
                         PropModeReplace, property_data, 38 );
    	
    Dan