aboutsummaryrefslogtreecommitdiffstats
path: root/src/macmenu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/macmenu.c')
-rw-r--r--src/macmenu.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/macmenu.c b/src/macmenu.c
index eb870176f12..54393bca594 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -823,7 +823,7 @@ cached information about equivalent key sequences. */)
823 823
824#ifdef HAVE_MENUS 824#ifdef HAVE_MENUS
825 825
826DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 2, 0, 826DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0,
827 doc: /* Pop up a dialog box and return user's selection. 827 doc: /* Pop up a dialog box and return user's selection.
828POSITION specifies which frame to use. 828POSITION specifies which frame to use.
829This is normally a mouse button event or a window or frame. 829This is normally a mouse button event or a window or frame.
@@ -838,9 +838,12 @@ The return value is VALUE from the chosen item.
838An ITEM may also be just a string--that makes a nonselectable item. 838An ITEM may also be just a string--that makes a nonselectable item.
839An ITEM may also be nil--that means to put all preceding items 839An ITEM may also be nil--that means to put all preceding items
840on the left of the dialog box and all following items on the right. 840on the left of the dialog box and all following items on the right.
841\(By default, approximately half appear on each side.) */) 841\(By default, approximately half appear on each side.)
842 (position, contents) 842
843 Lisp_Object position, contents; 843If HEADER is non-nil, the frame title for the box is "Information",
844otherwise it is "Question". */)
845 (position, contents, header)
846 Lisp_Object position, contents, header;
844{ 847{
845 FRAME_PTR f = NULL; 848 FRAME_PTR f = NULL;
846 Lisp_Object window; 849 Lisp_Object window;
@@ -927,7 +930,7 @@ on the left of the dialog box and all following items on the right.
927 930
928 /* Display them in a dialog box. */ 931 /* Display them in a dialog box. */
929 BLOCK_INPUT; 932 BLOCK_INPUT;
930 selection = mac_dialog_show (f, 0, title, &error_name); 933 selection = mac_dialog_show (f, 0, title, header, &error_name);
931 UNBLOCK_INPUT; 934 UNBLOCK_INPUT;
932 935
933 discard_menu_items (); 936 discard_menu_items ();
@@ -2046,10 +2049,10 @@ static char * button_names [] = {
2046 "button6", "button7", "button8", "button9", "button10" }; 2049 "button6", "button7", "button8", "button9", "button10" };
2047 2050
2048static Lisp_Object 2051static Lisp_Object
2049mac_dialog_show (f, keymaps, title, error) 2052mac_dialog_show (f, keymaps, title, header, error)
2050 FRAME_PTR f; 2053 FRAME_PTR f;
2051 int keymaps; 2054 int keymaps;
2052 Lisp_Object title; 2055 Lisp_Object title, header;
2053 char **error; 2056 char **error;
2054{ 2057{
2055 int i, nb_buttons=0; 2058 int i, nb_buttons=0;
@@ -2152,11 +2155,17 @@ mac_dialog_show (f, keymaps, title, error)
2152 wv->name = dialog_name; 2155 wv->name = dialog_name;
2153 wv->help = Qnil; 2156 wv->help = Qnil;
2154 2157
2158 /* Frame title: 'Q' = Question, 'I' = Information.
2159 Can also have 'E' = Error if, one day, we want
2160 a popup for errors. */
2161 if (NILP(header))
2162 dialog_name[0] = 'Q';
2163 else
2164 dialog_name[0] = 'I';
2165
2155 /* Dialog boxes use a really stupid name encoding 2166 /* Dialog boxes use a really stupid name encoding
2156 which specifies how many buttons to use 2167 which specifies how many buttons to use
2157 and how many buttons are on the right. 2168 and how many buttons are on the right. */
2158 The Q means something also. */
2159 dialog_name[0] = 'Q';
2160 dialog_name[1] = '0' + nb_buttons; 2169 dialog_name[1] = '0' + nb_buttons;
2161 dialog_name[2] = 'B'; 2170 dialog_name[2] = 'B';
2162 dialog_name[3] = 'R'; 2171 dialog_name[3] = 'R';