[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

2797.0. "Using DirectColor on a firefox" by XLIB::JACKSON (Collis Jackson) Mon May 21 1990 17:47

A question that has come up:

    The default visual class for widgets created on a firefox is TrueColor.
    The application I am developing requires a DirectColor window.  As far
    as I can see there is no way to change the visual for a widget.  I've
    tried changeing the realize call for the widget.  In the realize
    routine I used XMatchVisualInfo to get the visual for 24bits
    directcolor however when I do the XtCreateWindow I get a bad match
    error. However, if I use a visual of CopyFromParent I don't get this
    error, I also don't get a DirectColor Window, catch 22.
    The widget I was creating is a child of a scroll_window which
    was the child of a main_window.  The widget were created using UIL and
    if possible I'd like to do it this way.  I traped the realize call
    using the created callback in the UIL interface.  In the callback
    routine I changed the pointer
    widget->core.widget_class->core_class.realize to point to my realize
    routine. My realize routine was called. Is there a way to do this on
    vms 5.3?

				Thanks,

				Collis Jackson
T.RTitleUserPersonal
Name
DateLines
2797.1ColormapsLEOVAX::TREGGIARIWed May 23 1990 11:5332
>    In the realize
>    routine I used XMatchVisualInfo to get the visual for 24bits
>    directcolor however when I do the XtCreateWindow I get a bad match
>    error. 

That may be from the color map.  You could try calling XCreateWindow yourself
with a color map that matches the visual.  Note that setting XtNcolorMap
should do the job, but doesn't work until R4 Intrinsics.
Here's the "meat" of XtCreateWindow.

	widget->core.window =
	    XCreateWindow (
		XtDisplay (widget),
		(widget->core.parent ?
		    widget->core.parent->core.window :
		    widget->core.screen->root),
		(int)widget->core.x, (int)widget->core.y,
		(unsigned)widget->core.width, (unsigned)widget->core.height,
		(unsigned)widget->core.border_width, (int) widget->core.depth,
		window_class, visual, value_mask, attributes);


>    In the callback
>    routine I changed the pointer
>    widget->core.widget_class->core_class.realize to point to my realize
>    routine. My realize routine was called. 

Not a very "friendly" habit to get into.  Note that you are changing the
realize proc for *every* widget class of that type in your process...

Leo