From fa616ec497a0913e322c57f8561456a5def5607f Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Mon, 17 Jan 2000 09:09:39 +0000 Subject: [PATCH] (highlight_hook): New function. (xlw_create_menubar, xlw_create_popup_menu): Add highlight_hook as callback XtNhighlightCallback. --- lwlib/lwlib-Xlw.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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; } -- 2.39.5