From 3fcd018655f556a9949f4340589b552a7be26508 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Mon, 1 Jan 2007 15:20:33 +0000 Subject: [PATCH] (enter_hook, leave_hook): New functions (xlw_create_menubar, xlw_create_popup_menu): Connect XtNenter/leave to enter/leave_hook. --- lwlib/ChangeLog | 16 ++++++++++++++++ lwlib/lwlib-Xlw.c | 27 +++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 904d8eadf05..d3e8c2eb4c3 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@ -1,3 +1,19 @@ +2007-01-01 Jan Dj,Ad(Brv + + * xlwmenu.c (xlwMenuResources): Add XtNleaveCallback, XtNenterCallback. + (display_menu, map_event_to_widget_value): Generate enter and + leave callbacks. + (pop_up_menu): Initialize mw->menu.inside_entry. + + * xlwmenu.h (XtNleaveCallback, XtNenterCallback): New strings. + + * xlwmenuP.h (_XlwMenu_part): Add enter/leave callbacks and + inside_entry. + + * lwlib-Xlw.c (enter_hook, leave_hook): New functions + (xlw_create_menubar, xlw_create_popup_menu): Connect XtNenter/leave + to enter/leave_hook. + 2006-10-30 Chong Yidong * Makefile.in (lwlib-utils.o): Use CPPFLAGS. diff --git a/lwlib/lwlib-Xlw.c b/lwlib/lwlib-Xlw.c index 4799b1dbd9d..dd366e4cca1 100644 --- a/lwlib/lwlib-Xlw.c +++ b/lwlib/lwlib-Xlw.c @@ -83,6 +83,25 @@ highlight_hook (w, client_data, call_data) instance->info->highlight_cb (w, instance->info->id, call_data); } +static void +enter_hook (w, client_data, call_data) + Widget w; + XtPointer client_data; + XtPointer call_data; +{ + highlight_hook (w, client_data, call_data); +} + +static void +leave_hook (w, client_data, call_data) + Widget w; + XtPointer client_data; + XtPointer call_data; +{ + highlight_hook (w, client_data, NULL); +} + + static void pre_hook (w, client_data, call_data) Widget w; @@ -152,8 +171,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); + XtAddCallback (widget, XtNleaveCallback, leave_hook, (XtPointer)instance); + XtAddCallback (widget, XtNenterCallback, enter_hook, (XtPointer)instance); return widget; } @@ -179,8 +198,8 @@ xlw_create_popup_menu (instance) popup_shell, al, ac); XtAddCallback (widget, XtNselect, pick_hook, (XtPointer)instance); - XtAddCallback (widget, XtNhighlightCallback, highlight_hook, - (XtPointer)instance); + XtAddCallback (widget, XtNleaveCallback, leave_hook, (XtPointer)instance); + XtAddCallback (widget, XtNenterCallback, enter_hook, (XtPointer)instance); return popup_shell; } -- 2.39.2