[comp.windows.x] Resource conversion

jne@goldhill.COM (08/16/89)

Using X11R3 with Xt.

Question:  When do the resources specified in the default
resources of a widget class get converted to their actual value.
For example, in Xaw/Scroll.c, the default resource for 
the scrollbarWidgetClass contains the following lines:

  {XtNscrollVCursor, XtCCursor, XtRCursor, sizeof(Cursor),
	     Offset(scrollbar.verCursor), XtRString, "sb_v_double_arrow"},

Is the string converted to an actual cursor object (using 
XCreateFontCursor just once (at class initialization time?),
or every time a widget is created, or something else.

The reason I ask is because I am doing a 
   XtDestroyApplicationContext(app_context) ;
and then recreating an app_context and new display.
It seems that after I create the new display, I am getting
BadCursor errors because the old value used by
XCreateFontCursor for the old display is being reused (without
calling XCreateFontCursor again for the new display).

Jeff Eisen
Gold Hill Computers
617-621-3404

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (08/18/89)

> When do the resources specified in the default
> resources of a widget class get converted to their actual value.

At widget creation time, before the widget's initialize routine
is called.

> Is the string converted to an actual cursor object (using 
> XCreateFontCursor just once (at class initialization time?),
> or every time a widget is created, or something else.

It is converted for each widget, but the converters cache this information.

> The reason I ask is because I am doing a 
> XtDestroyApplicationContext(app_context) ; and then recreating an app_context
> and new display.  It seems that after I create the new display, I am getting
> BadCursor errors because the old value used by XCreateFontCursor for the old
> display is being reused (without calling XCreateFontCursor again for the new
> display).  

This is a (known) bug in the toolkit.  It seems that the cursors are cached
on a per application basis rather than a per display basis.  We are working
on fixing this problem.  Until we fix it here you lose, sorry.  The multiple
display stuff in the R3 Xt is pretty buggy, I would stay away from it until
R4 if you can possible do it.

						Chris D. Peterson     
						MIT X Consortium 

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