[comp.windows.x] How to use the Dialog Widget more effectively.

kit@ATHENA.MIT.EDU (Chris D. Peterson) (12/17/88)

Here is some general information about the Athena dialog widget.

This widget is composed of several sub widgets, and sometimes is
is necessary to go in and work with these values to get the exact behavior
that you would like.  

The dialog widget it self is a subclass of the form widget, and has all
the properties of a form.  The advantage to using the dialog is that is
comes with some free children.

Always:						Label Widget: 	name "label"
If you specify a value then you also get: 	Text Widget: 	name "value"
and, of course, any buttons add with XtDialogAddButton().

		     dialog

	/	/	|	\	\

     label    text     button1   button2 .......

By using the function XtNameToWidget() with a starting search point of the
dialog widget you have the means to go a get the widget id's for each of
the children of the dialog.

Here are a few examples of what this allows you do do.

> From: att!cbnews!djb@bloom-beacon.mit.edu  (David J. Bryant)
> Subject: Novice vs. Xaw Dialog Widget

> Everything works just ducky, except I can't figure out
> how to clear the value area in the widget after the user has hit either
> "cancel" or "confirm".			

Do an XtTextReplace on the string in the text widget using the id
retrieved by the above method.

> From: hrp@snoid.cray.com (Hal Peterson)
> Subject: Form widget question

> Are there any plans to add an XtNorientation resource to the Dialog
> widget?  It would be handy to be able to specify a Dialog like

This is already there, just change the constraint resources on the text
widget to:

XtNfromVert	NULL
XtNfromHoriz	label widget id.

This can all be done, once you have the widgets id's.

> From: Oliver Laumann <net%TUB.BITNET@mitvma.mit.edu>
> Subject: Xt/Xaw question

> Is it possible for a client to set the `font' resource of the label
> widget contained in a dialog widget (or, in general, any resource
> of the sub-widgets created by a dialog)?

Just like a normal label widget, once you have the label's id number,
Use XtGetValues.
						Chris D. Peterson     
						MIT X Consortium /
						Project Athena 

Net:	kit@athena.mit.edu		
Phone: (617) 253 - 1326			
USMail: MIT - Room E40-342C		
	77 Massachusetts Ave.		
	Cambridge, MA 02139