[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

581.0. "Application specific Visual?" by LDP::WEAVER (Laboratory Data Products/Science) Tue Apr 11 1989 18:14

    I am trying to create a PseudoColor visual on a Firefox.  I can
    create the visual, and a colormap, the problem I have is how do
    I associate that visual with my applications toplevel widget so
    that all subsequent widgets will use the visual?  It seems like
    a catch-22 in that normaly you specify the visual when you create
    a window, but XtInitialize is creating the toplevel window for me.
    
    So how do I associate a different visual type with an XUI widget?
    
    Is there any way I can change the default visual of the display?
    
    						Thanks,
    						-Dave

T.RTitleUserPersonal
Name
DateLines
581.1PSW::WINALSKIPaul S. WinalskiTue Apr 11 1989 19:1315
The visual is associated with the colormap, and it is the colormap that you
want to associate with your application.  I would approach the problem as
follows:

1) Locate the PseudoColor visual
2) Create the colormap using that visual
3) Call XtInitialize
4) Use XtSetValues to set the XtNcolormap resource on the shell widget that
   XtInitialize returned
5) Create the rest of your window hierarchy (or fetch it using Drm, or what
   have you)
6) Realize and manage everything

--PSW

581.2Not so simple, at least for what I was trying to doHANNAH::MESSENGERBob MessengerTue Apr 11 1989 20:5310
Re: .0

I've tried to do the same thing in DECterm, but with no luck so far.  My
problem isn't quite the same as yours, though, since DECterm is a widget.
The trouble is that XtCreateWindow insists on using the default colormap
instead of the one I set in my widget structure.  I might try again later
when I have more time.

				-- Bob

581.3Also lost in the void...NOBOZO::WEBERWed Apr 12 1989 10:2115
    We're trying to do the same thing with almost as little success. We've
    found that:
    
    o private colormaps are not associated with widget windows by the
      toolkit.
    
    o altering the colormap resource using XtSetValues does not result in
      the colormap being associated with the widget window.
    
    Some guidance in the proper technique for using private colormaps with
    the toolkit is needed here I think.
    
    /John
    

581.4I'll try it...LDP::WEAVERLaboratory Data Products/ScienceWed Apr 12 1989 15:5812
    Re: .1
    
    Do you use the root window when creating the colormap?
    
    One of my problems has been that I can't get the shell widgets window
    using XtWindow until the shell widget is realized and I was trying
    to use the shell widget's window to create the colormap.  I suppose
    it can't hurt to try using the root window instead.
    
    						Thanks,
    						-Dave

581.5No luck so far...LDP::WEAVERLaboratory Data Products/ScienceWed Apr 12 1989 17:3822
    Re: .1
    
    I tried your suggestion with the following modifications:
    
    1) Call XtInitialize
    2) Locate the PseudoColor visual
    3) Create the colormap using that visual
    4) Use XtSetValues to set the XtNcolormap resource on the shell
    widget that XtInitialize returned
    5) Create the rest of your window hierarchy (or fetch it using Drm,
    or what have you)
    6) Realize and manage everything
    
    What happens is that I see my main_window widget appear, followed
    by an Xserver crash shortly thereafter.  I used the root_window
    when creating the color map.  It isn't clear what actually caused
    the server to crash.
    
    Any other suggestions?
    
    						-Dave

581.6Perhaps stating the obviousSARAH::BUEHLERTact. At all times: tact.Sat Apr 15 1989 00:4425
    My understanding of the current state of the toolkit code is that they
    never set the actual colormap on the windows that they create,
    regardless of what you tell the toolkit to do.  A manual setting of the
    colormap via XSetWindowColormap should work.
    
    I do the sequence
    
    1) XtInitialize
    2) Locate the PseudoColor visual
    3) Create the colormap using that visual
    4) Use XtSetValues to set the XtNcolormap resource on the shell
    5) Use DwtGetWindow (or whatever) to get the windows of the widget
          hierarchy that I'm using (shell, main window, window).
    6) Use XSetWindowColormap to explicitly set the colormap on each of
          the windows that are used by my widgets.
    7) Realize and manage everything.
    
    Step 4 may be totally extraneous, I don't really recall.  Step 6 was
    the critical step for me.
    
    You may be going for some sort of inheritance, but I have no idea what
    things are actually going on at that level.
    
John

581.7The visual's the thingDECWIN::FISHERBurns Fisher 381-1466, ZKO3-4/W23Mon Apr 17 1989 11:3413
Trouble is, you need more than a colormap.  How do you convince the toolkit
to create the window with the right Visual if it is not the default one?
There is a catch-22 here...1) you can't just set a colormap of a different
visual into the window, and 2) you can't create a window with a non-default
visual type without specifying a new colormap in the create call (since
otherwise, the colormap defaults to the parent, which is probably of the
default visual).

Have you (in .-1) actually done this with a non-default visual, or just for
using a different colormap in the default visual?

Burns

581.8I better keep my mouth shutEPIK::BUEHLERTact. At all times: tact.Mon Apr 17 1989 15:288
>Have you (in .-1) actually done this with a non-default visual, or just for
>using a different colormap in the default visual?
    
    Ah, point.  I'm using the visuals that I can locate with
    XMatchVisualInfo.
    
John