116 |
|
|
117 |
static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **)); |
static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **)); |
118 |
static void popup_get_selection P_ ((XEvent *, struct x_display_info *, |
static void popup_get_selection P_ ((XEvent *, struct x_display_info *, |
119 |
LWLIB_ID, int, int)); |
LWLIB_ID, int)); |
120 |
|
|
121 |
/* Define HAVE_BOXES if menus can handle radio and toggle buttons. */ |
/* Define HAVE_BOXES if menus can handle radio and toggle buttons. */ |
122 |
|
|
1186 |
popped down (deactivated). This is used for x-popup-menu |
popped down (deactivated). This is used for x-popup-menu |
1187 |
and x-popup-dialog; it is not used for the menu bar. |
and x-popup-dialog; it is not used for the menu bar. |
1188 |
|
|
|
If DOWN_ON_KEYPRESS is nonzero, pop down if a key is pressed. |
|
|
|
|
1189 |
NOTE: All calls to popup_get_selection should be protected |
NOTE: All calls to popup_get_selection should be protected |
1190 |
with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */ |
with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */ |
1191 |
|
|
1192 |
static void |
static void |
1193 |
popup_get_selection (initial_event, dpyinfo, id, do_timers, down_on_keypress) |
popup_get_selection (initial_event, dpyinfo, id, do_timers) |
1194 |
XEvent *initial_event; |
XEvent *initial_event; |
1195 |
struct x_display_info *dpyinfo; |
struct x_display_info *dpyinfo; |
1196 |
LWLIB_ID id; |
LWLIB_ID id; |
1197 |
int do_timers; |
int do_timers; |
|
int down_on_keypress; |
|
1198 |
{ |
{ |
1199 |
XEvent event; |
XEvent event; |
1200 |
|
|
1231 |
} |
} |
1232 |
/* Pop down on C-g and Escape. */ |
/* Pop down on C-g and Escape. */ |
1233 |
else if (event.type == KeyPress |
else if (event.type == KeyPress |
|
&& down_on_keypress |
|
1234 |
&& dpyinfo->display == event.xbutton.display) |
&& dpyinfo->display == event.xbutton.display) |
1235 |
{ |
{ |
1236 |
KeySym keysym = XLookupKeysym (&event.xkey, 0); |
KeySym keysym = XLookupKeysym (&event.xkey, 0); |
2595 |
make_number (menu_id & ~(-1 << (fact))))); |
make_number (menu_id & ~(-1 << (fact))))); |
2596 |
|
|
2597 |
/* Process events that apply to the menu. */ |
/* Process events that apply to the menu. */ |
2598 |
popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), menu_id, 1, 0); |
popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), menu_id, 1); |
2599 |
|
|
2600 |
unbind_to (specpdl_count, Qnil); |
unbind_to (specpdl_count, Qnil); |
2601 |
} |
} |
2973 |
make_number (dialog_id & ~(-1 << (fact))))); |
make_number (dialog_id & ~(-1 << (fact))))); |
2974 |
|
|
2975 |
popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), |
popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), |
2976 |
dialog_id, 1, 1); |
dialog_id, 1); |
2977 |
|
|
2978 |
unbind_to (count, Qnil); |
unbind_to (count, Qnil); |
2979 |
} |
} |