602 |
} |
} |
603 |
} |
} |
604 |
|
|
605 |
|
static Lisp_Object |
606 |
|
cleanup_popup_menu (arg) |
607 |
|
Lisp_Object arg; |
608 |
|
{ |
609 |
|
discard_menu_items (); |
610 |
|
} |
611 |
|
|
612 |
DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, |
DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, |
613 |
doc: /* Pop up a deck-of-cards menu and return user's selection. |
doc: /* Pop up a deck-of-cards menu and return user's selection. |
614 |
POSITION is a position specification. This is either a mouse button |
POSITION is a position specification. This is either a mouse button |
654 |
int keymaps = 0; |
int keymaps = 0; |
655 |
int for_click = 0; |
int for_click = 0; |
656 |
struct gcpro gcpro1; |
struct gcpro gcpro1; |
657 |
|
int specpdl_count = SPECPDL_INDEX (); |
658 |
|
|
659 |
|
|
660 |
#ifdef HAVE_MENUS |
#ifdef HAVE_MENUS |
661 |
if (! NILP (position)) |
if (! NILP (position)) |
815 |
|
|
816 |
#ifdef HAVE_MENUS |
#ifdef HAVE_MENUS |
817 |
/* Display them in a menu. */ |
/* Display them in a menu. */ |
818 |
|
record_unwind_protect (cleanup_popup_menu, Qnil); |
819 |
BLOCK_INPUT; |
BLOCK_INPUT; |
820 |
|
|
821 |
selection = mac_menu_show (f, xpos, ypos, for_click, |
selection = mac_menu_show (f, xpos, ypos, for_click, |
822 |
keymaps, title, &error_name); |
keymaps, title, &error_name); |
823 |
UNBLOCK_INPUT; |
UNBLOCK_INPUT; |
824 |
|
unbind_to (specpdl_count, Qnil); |
|
discard_menu_items (); |
|
825 |
|
|
826 |
UNGCPRO; |
UNGCPRO; |
827 |
#endif /* HAVE_MENUS */ |
#endif /* HAVE_MENUS */ |
1940 |
} |
} |
1941 |
} |
} |
1942 |
} |
} |
1943 |
|
else if (!for_click) |
1944 |
|
/* Make "Cancel" equivalent to C-g. */ |
1945 |
|
Fsignal (Qquit, Qnil); |
1946 |
|
|
1947 |
return Qnil; |
return Qnil; |
1948 |
} |
} |