diff options
author | Jan Djärv <jan.h.d@swipnet.se> | 2011-07-25 23:49:42 +0200 |
---|---|---|
committer | Jan Djärv <jan.h.d@swipnet.se> | 2011-07-25 23:49:42 +0200 |
commit | d6f0886cf1d99d80c45a8a57a7bcce42dc623c3c (patch) | |
tree | afccfbba7202266647dcb8c8917b0b3425e89fe5 | |
parent | 2eb1f9e6a50ae13ada9a019e42fb6969f935454f (diff) | |
download | emacs-d6f0886cf1d99d80c45a8a57a7bcce42dc623c3c.tar.gz emacs-d6f0886cf1d99d80c45a8a57a7bcce42dc623c3c.tar.bz2 emacs-d6f0886cf1d99d80c45a8a57a7bcce42dc623c3c.zip |
* nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
are specified.
Fixes: debbugs:9168
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/nsmenu.m | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3fc8067e114..dd25d155c66 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-07-25 Jan Djärv <jan.h.d@swipnet.se> + + * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons + are specified (Bug#9168). + 2011-07-25 Paul Eggert <eggert@cs.ucla.edu> * bidi.c (bidi_dump_cached_states): Fix printf format mismatch. diff --git a/src/nsmenu.m b/src/nsmenu.m index 6a9ee7dd4f5..6931b7a3c01 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1340,7 +1340,7 @@ Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) { id dialog; - Lisp_Object window, tem; + Lisp_Object window, tem, title; struct frame *f; NSPoint p; BOOL isQ; @@ -1389,6 +1389,14 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) p.x = (int)f->left_pos + ((int)FRAME_COLUMN_WIDTH (f) * f->text_cols)/2; p.y = (int)f->top_pos + (FRAME_LINE_HEIGHT (f) * f->text_lines)/2; + title = Fcar (contents); + CHECK_STRING (title); + + if (NILP (Fcar (Fcdr (contents)))) + /* No buttons specified, add an "Ok" button so users can pop down + the dialog. */ + contents = Fcons (title, Fcons (Fcons (build_string ("Ok"), Qt), Qnil)); + BLOCK_INPUT; dialog = [[EmacsDialogPanel alloc] initFromContents: contents isQuestion: isQ]; |