+/* Called for key press in dialogs. Used to pop down dialog on ESC. */
+static void
+dialog_key_cb (widget, closure, event, continue_to_dispatch)
+ Widget widget;
+ XtPointer closure;
+ XEvent *event;
+ Boolean *continue_to_dispatch;
+{
+ KeySym sym = 0;
+ Modifiers modif_ret;
+
+ XtTranslateKeycode (event->xkey.display, event->xkey.keycode, 0,
+ &modif_ret, &sym);
+
+ if (sym == osfXK_Cancel)
+ {
+ Widget w = *((Widget *) closure);
+
+ while (w && ! XtIsShell (w))
+ w = XtParent (w);
+
+ if (XtIsShell (w)) XtPopdown (w);
+ }
+
+ *continue_to_dispatch = TRUE;
+}
+