diff options
| author | Jan Djärv | 2011-07-25 23:49:42 +0200 |
|---|---|---|
| committer | Jan Djärv | 2011-07-25 23:49:42 +0200 |
| commit | d6f0886cf1d99d80c45a8a57a7bcce42dc623c3c (patch) | |
| tree | afccfbba7202266647dcb8c8917b0b3425e89fe5 /src/nsmenu.m | |
| parent | 2eb1f9e6a50ae13ada9a019e42fb6969f935454f (diff) | |
| download | emacs-d6f0886cf1d99d80c45a8a57a7bcce42dc623c3c.tar.gz emacs-d6f0886cf1d99d80c45a8a57a7bcce42dc623c3c.zip | |
* nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
are specified.
Fixes: debbugs:9168
Diffstat (limited to 'src/nsmenu.m')
| -rw-r--r-- | src/nsmenu.m | 10 |
1 files changed, 9 insertions, 1 deletions
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 | |||
| 1340 | ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) | 1340 | ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) |
| 1341 | { | 1341 | { |
| 1342 | id dialog; | 1342 | id dialog; |
| 1343 | Lisp_Object window, tem; | 1343 | Lisp_Object window, tem, title; |
| 1344 | struct frame *f; | 1344 | struct frame *f; |
| 1345 | NSPoint p; | 1345 | NSPoint p; |
| 1346 | BOOL isQ; | 1346 | BOOL isQ; |
| @@ -1389,6 +1389,14 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) | |||
| 1389 | p.x = (int)f->left_pos + ((int)FRAME_COLUMN_WIDTH (f) * f->text_cols)/2; | 1389 | p.x = (int)f->left_pos + ((int)FRAME_COLUMN_WIDTH (f) * f->text_cols)/2; |
| 1390 | p.y = (int)f->top_pos + (FRAME_LINE_HEIGHT (f) * f->text_lines)/2; | 1390 | p.y = (int)f->top_pos + (FRAME_LINE_HEIGHT (f) * f->text_lines)/2; |
| 1391 | 1391 | ||
| 1392 | title = Fcar (contents); | ||
| 1393 | CHECK_STRING (title); | ||
| 1394 | |||
| 1395 | if (NILP (Fcar (Fcdr (contents)))) | ||
| 1396 | /* No buttons specified, add an "Ok" button so users can pop down | ||
| 1397 | the dialog. */ | ||
| 1398 | contents = Fcons (title, Fcons (Fcons (build_string ("Ok"), Qt), Qnil)); | ||
| 1399 | |||
| 1392 | BLOCK_INPUT; | 1400 | BLOCK_INPUT; |
| 1393 | dialog = [[EmacsDialogPanel alloc] initFromContents: contents | 1401 | dialog = [[EmacsDialogPanel alloc] initFromContents: contents |
| 1394 | isQuestion: isQ]; | 1402 | isQuestion: isQ]; |