diff options
author | Jan Djärv <jan.h.d@swipnet.se> | 2004-01-12 01:45:22 +0000 |
---|---|---|
committer | Jan Djärv <jan.h.d@swipnet.se> | 2004-01-12 01:45:22 +0000 |
commit | 244c93fe5767497dd45bb3d3ad22a9c72ccc2d5b (patch) | |
tree | d383c54483d68845ca5ce18f92491bc097d78a94 /lwlib/lwlib-Xaw.c | |
parent | 0fbe422d1c18358c87d481898d25bad7e2bd02da (diff) | |
download | emacs-244c93fe5767497dd45bb3d3ad22a9c72ccc2d5b.tar.gz |
Changes for lucid popup menus (keyboard traversal enabled) and dialogs
(Xaw and Xm pop down on ESC).
Diffstat (limited to 'lwlib/lwlib-Xaw.c')
-rw-r--r-- | lwlib/lwlib-Xaw.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c index 7f37596457f..867193c7cc8 100644 --- a/lwlib/lwlib-Xaw.c +++ b/lwlib/lwlib-Xaw.c @@ -277,6 +277,9 @@ xaw_pop_instance (instance, up) static char overrideTrans[] = "<Message>WM_PROTOCOLS: lwlib_delete_dialog()"; +/* Dialogs pop down on any key press */ +static char dialogOverride[] = + "<KeyPress>: lwlib_delete_dialog()"; static void wm_delete_window(); static XtActionsRec xaw_actions [] = { {"lwlib_delete_dialog", wm_delete_window} @@ -333,6 +336,8 @@ make_dialog (name, parent, pop_up_p, shell_title, icon_name, text_input_slot, ra ac = 0; dialog = XtCreateManagedWidget (name, dialogWidgetClass, shell, av, ac); + override = XtParseTranslationTable (dialogOverride); + XtOverrideTranslations (dialog, override); bc = 0; button = 0; @@ -511,8 +516,8 @@ xaw_generic_callback (widget, closure, call_data) } static void -wm_delete_window (shell, closure, call_data) - Widget shell; +wm_delete_window (w, closure, call_data) + Widget w; XtPointer closure; XtPointer call_data; { @@ -520,7 +525,13 @@ wm_delete_window (shell, closure, call_data) Cardinal nkids; int i; Widget *kids = 0; - Widget widget; + Widget widget, shell; + + if (XtIsSubclass (w, dialogWidgetClass)) + shell = XtParent (w); + else + shell = w; + if (! XtIsSubclass (shell, shellWidgetClass)) abort (); XtVaGetValues (shell, XtNnumChildren, &nkids, NULL); |