[comp.windows.x] Changing Widgets

mazer@bek-owl.caltech.edu (Jamie Mazer) (07/06/90)

This may be an obvious question, but I can't seem to figure out
how to tell which resources can be changed on the fly for a
given athena widget. To be precise, in a label widget, I can
reverse it and change the text as follows:
    WidgetSet(someLabelWidget,
	      XtNlabel, (String) p,
	      XtNforeground, (Pixel) background,
	      XtNbackground, (Pixel) foreground, NULL);
On the other hand, why can't I do the following:
	WidgetSet(someTextWidget,
		  XtNeditType, XttextRead,
		  XtNborderWidth, (Dimension) 0, NULL);
to make a text widget lose it's border and become read only?

It looks like it should work from the Xaw docs, but seems to
have no effect (it doesn't seem to have anything to do with
using WidgetWrap :-). Am I missing something obvious that's
in the doc?

Please reply to me, as I'm have trouble keeping up with the
volume of comp.windows.x these days. Thanks a lot.
/Jamie
/  mazer@bek-owl.caltech.edu \
\ jmazer@caltech.bitnet      /

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (07/06/90)

> On the other hand, why can't I do the following:
>	WidgetSet(someTextWidget,
>		  XtNeditType, XttextRead,

This should work in the R4 Athena Text widget, the behavior of the Athena
Text widget was somewhat broken in proir releases, and several resource were
read only, because the code to make them writable had not been implemented
correctly.

>		  XtNborderWidth, (Dimension) 0, NULL);

This is most likely happening because the parent of the Text widget is
disallowing geometry requests.  Since a change in the border width would change
the geometry of the widget, the parent has the final say as to whether or not
this setvalues request will succeed.  Several of the Athena composite widgets
disallow geometry changes of their children by default, but have a resource that
will allow geometry changes to succeed it you want that behavior.


						Chris D. Peterson