[comp.windows.x] Associating an action routine with the value field of a dialog widget

sandra@cs.arizona.edu (Sandy Miller) (12/05/89)

I am trying to associate an action routine with the value field (input
line) of a dialog widget, and was wondering if anyone has done this before. 
I have a simple dialog widget which prompts the user to enter a filename.
There are two command buttons for the user to "confirm" or "cancel"
the filename, and these work fine.  But I would also like to process
the filename if the user types a carriage return, in the same way I
process it if the confirm button is pressed.  I can associate an action
routine with the dialog widget, but that doesn't work for actions inside
the "value" widget.  Anyone have any ideas??

Thanks in advance for any help,
-Sandy

meo@stiatl.UUCP (Miles O'Neal) (12/06/89)

In article <15908@megaron.cs.arizona.edu> sandra@cs.arizona.edu (Sandy Miller) writes:
|I am trying to associate an action routine with the value field (input
|line) of a dialog widget, and was wondering if anyone has done this before. 
|I have a simple dialog widget which prompts the user to enter a filename.
|There are two command buttons for the user to "confirm" or "cancel"
|the filename, and these work fine.  But I would also like to process
|the filename if the user types a carriage return, in the same way I
|process it if the confirm button is pressed.  I can associate an action
|routine with the dialog widget, but that doesn't work for actions inside
|the "value" widget.  Anyone have any ideas??

We cheat. But this will work. We created a file with routines that
return the widget pointers for subwidgets of the packaged widgets
we created (including an enhanced Dialog widget). So you can override
translations using asomething like

W = GetDialogTextPtr (dialogWidgetPtr);
XtOverrideTranslations (W, (XtTranslations)XtParseTranslationTable (IT));

The GetDialogTextPtr() basically just returns the appropriate pointer,
using the DialogP.h file to get the structure.

-Miles O'Neal
{yr fave backbone here}!emory!stiatl!meo