summaryrefslogtreecommitdiff
path: root/lwlib/lwlib-Xlw.c
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-01-17 09:09:39 +0000
committerGerd Moellmann <gerd@gnu.org>2000-01-17 09:09:39 +0000
commitfa616ec497a0913e322c57f8561456a5def5607f (patch)
treeb4eebf4dd0a55f2abfb35e6307f89975e7c2f69c /lwlib/lwlib-Xlw.c
parentd3065ce277122a6cc45bcc07227abee3fcd3fb60 (diff)
downloademacs-fa616ec497a0913e322c57f8561456a5def5607f.tar.gz
(highlight_hook): New function.
(xlw_create_menubar, xlw_create_popup_menu): Add highlight_hook as callback XtNhighlightCallback.
Diffstat (limited to 'lwlib/lwlib-Xlw.c')
-rw-r--r--lwlib/lwlib-Xlw.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/lwlib/lwlib-Xlw.c b/lwlib/lwlib-Xlw.c
index ee6596c27ef..bcc2198ff4f 100644
--- a/lwlib/lwlib-Xlw.c
+++ b/lwlib/lwlib-Xlw.c
@@ -31,6 +31,26 @@ Boston, MA 02111-1307, USA. */
#include "xlwmenu.h"
/* Menu callbacks */
+
+/* Callback XtNhighlightCallback for Lucid menus. W is the menu
+ widget, CLIENT_DATA contains a pointer to the widget_instance
+ for the menu, CALL_DATA contains a pointer to the widget_value
+ structure for the highlighted menu item. The latter may be null
+ if there isn't any highlighted menu item. */
+
+static void
+highlight_hook (w, client_data, call_data)
+ Widget w;
+ XtPointer client_data;
+ XtPointer call_data;
+{
+ widget_instance *instance = (widget_instance *) client_data;
+
+ if (instance->info->highlight_cb
+ && !w->core.being_destroyed)
+ instance->info->highlight_cb (w, instance->info->id, call_data);
+}
+
static void
pre_hook (w, client_data, call_data)
Widget w;
@@ -100,6 +120,8 @@ xlw_create_menubar (instance)
XtAddCallback (widget, XtNopen, pre_hook, (XtPointer)instance);
XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
+ XtAddCallback (widget, XtNhighlightCallback, highlight_hook,
+ (XtPointer)instance);
return widget;
}
@@ -125,7 +147,8 @@ xlw_create_popup_menu (instance)
popup_shell, al, ac);
XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance);
-
+ XtAddCallback (widget, XtNhighlightCallback, highlight_hook,
+ (XtPointer)instance);
return popup_shell;
}