[comp.windows.x] Changing the name of an already created widget

converse@EXPO.LCS.MIT.EDU (12/14/90)

> 1. Will changing the name of an already created widget have any ill effects?

Yes

> 2. Is there a way that I can change the resource settings for a widget to
> 	reflect a name change?

There is no way to change the name of an existing widget.

melby@daffy.yk.Fujitsu.CO.JP (John B. Melby) (12/17/90)

>> 1. Will changing the name of an already created widget have any ill effects?
>Yes
>> 2. Is there a way that I can change the resource settings for a widget to
>> 	reflect a name change?
> There is no way to change the name of an existing widget.

Sure there is...
	w->core.name = s;
	w->core.xrm_name = XrmStringToQuark(s);

Of course, this will not be sufficient if you're looking for a way to modify
the defaults.

-----
John B. Melby
Fujitsu Limited, Machida, Japan
melby%yk.fujitsu.co.jp@uunet

converse@EXPO.LCS.MIT.EDU (12/17/90)

Someone asks:

	Is there a way that I can change the resource settings for a widget to
  	reflect a name change?

and I reply:

	There is no way to change the name of an existing widget.

And John Melby responds:

	Sure there is...
	 	w->core.name = s;
	 	w->core.xrm_name = XrmStringToQuark(s);

This is not portable.  It will leave the widget in an inconsistent state.
The Xt specification defines the type Widget to be opaque to the
application programmer.  This is clearly presented in Chapter 1.  The 
implementation header files are arranged so that the compiler will enforce 
the abstraction.  The Xt library does not provide a method to change the 
name of a widget.  

	Of course, this will not be sufficient if you're looking for a way 
	to modify the defaults.

An application programmer can change a widget's resources with XtSetValues.