T.R | Title | User | Personal Name | Date | Lines |
---|
581.1 | | PSW::WINALSKI | Paul S. Winalski | Tue Apr 11 1989 19:13 | 15 |
| 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.2 | Not so simple, at least for what I was trying to do | HANNAH::MESSENGER | Bob Messenger | Tue Apr 11 1989 20:53 | 10 |
| 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.3 | Also lost in the void... | NOBOZO::WEBER | | Wed Apr 12 1989 10:21 | 15 |
| 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.4 | I'll try it... | LDP::WEAVER | Laboratory Data Products/Science | Wed Apr 12 1989 15:58 | 12 |
| 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.5 | No luck so far... | LDP::WEAVER | Laboratory Data Products/Science | Wed Apr 12 1989 17:38 | 22 |
| 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.6 | Perhaps stating the obvious | SARAH::BUEHLER | Tact. At all times: tact. | Sat Apr 15 1989 00:44 | 25 |
| 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.7 | The visual's the thing | DECWIN::FISHER | Burns Fisher 381-1466, ZKO3-4/W23 | Mon Apr 17 1989 11:34 | 13 |
| 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.8 | I better keep my mouth shut | EPIK::BUEHLER | Tact. At all times: tact. | Mon Apr 17 1989 15:28 | 8 |
| >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
|