comparison src/xmenu.c @ 27425:e575223479a1

(popup_activated_flag): Make externally visible. (popup_activate_callback) [USE_MOTIF]: Increment popup_activated_flag. (popup_deactivate_callback) [USE_MOTIF]: Decrement it.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 25 Jan 2000 15:53:29 +0000
parents ab22130d8fe3
children 2bfd43d89c8e
comparison
equal deleted inserted replaced
27424:b696009c6586 27425:e575223479a1
187 /* Current depth within submenus. */ 187 /* Current depth within submenus. */
188 static int menu_items_submenu_depth; 188 static int menu_items_submenu_depth;
189 189
190 /* Flag which when set indicates a dialog or menu has been posted by 190 /* Flag which when set indicates a dialog or menu has been posted by
191 Xt on behalf of one of the widget sets. */ 191 Xt on behalf of one of the widget sets. */
192 static int popup_activated_flag; 192 int popup_activated_flag;
193 193
194 static int next_menubar_widget_id; 194 static int next_menubar_widget_id;
195 195
196 /* This is set nonzero after the user activates the menu bar, and set 196 /* This is set nonzero after the user activates the menu bar, and set
197 to zero again after the menu bars are redisplayed by prepare_menu_bar. 197 to zero again after the menu bars are redisplayed by prepare_menu_bar.
1147 popup_activated () 1147 popup_activated ()
1148 { 1148 {
1149 return popup_activated_flag; 1149 return popup_activated_flag;
1150 } 1150 }
1151 1151
1152
1153 /* This callback is invoked when the user selects a menubar cascade 1152 /* This callback is invoked when the user selects a menubar cascade
1154 pushbutton, but before the pulldown menu is posted. */ 1153 pushbutton, but before the pulldown menu is posted. */
1155 1154
1156 static void 1155 static void
1157 popup_activate_callback (widget, id, client_data) 1156 popup_activate_callback (widget, id, client_data)
1158 Widget widget; 1157 Widget widget;
1159 LWLIB_ID id; 1158 LWLIB_ID id;
1160 XtPointer client_data; 1159 XtPointer client_data;
1161 { 1160 {
1161 #ifdef USE_MOTIF
1162 ++popup_activated_flag;
1163 #else
1162 popup_activated_flag = 1; 1164 popup_activated_flag = 1;
1165 #endif
1166 }
1167
1168 /* This callback is invoked when a dialog or menu is finished being
1169 used and has been unposted. */
1170
1171 static void
1172 popup_deactivate_callback (widget, id, client_data)
1173 Widget widget;
1174 LWLIB_ID id;
1175 XtPointer client_data;
1176 {
1177 #ifdef USE_MOTIF
1178 --popup_activated_flag;
1179 #else
1180 popup_activated_flag = 0;
1181 #endif
1163 } 1182 }
1164 1183
1165 /* Lwlib callback called when menu items are highlighted/unhighlighted 1184 /* Lwlib callback called when menu items are highlighted/unhighlighted
1166 while moving the mouse over them. WIDGET is the menu bar or menu 1185 while moving the mouse over them. WIDGET is the menu bar or menu
1167 popup widget. ID is its LWLIB_ID. CALL_DATA contains a pointer to 1186 popup widget. ID is its LWLIB_ID. CALL_DATA contains a pointer to
1287 return; 1306 return;
1288 } 1307 }
1289 i += MENU_ITEMS_ITEM_LENGTH; 1308 i += MENU_ITEMS_ITEM_LENGTH;
1290 } 1309 }
1291 } 1310 }
1292 }
1293
1294 /* This callback is invoked when a dialog or menu is finished being
1295 used and has been unposted. */
1296
1297 static void
1298 popup_deactivate_callback (widget, id, client_data)
1299 Widget widget;
1300 LWLIB_ID id;
1301 XtPointer client_data;
1302 {
1303 popup_activated_flag = 0;
1304 } 1311 }
1305 1312
1306 /* Allocate a widget_value, blocking input. */ 1313 /* Allocate a widget_value, blocking input. */
1307 1314
1308 widget_value * 1315 widget_value *