emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105322: * nsmenu.m (ns_popup_dialog)


From: Jan D.
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105322: * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
Date: Mon, 25 Jul 2011 23:49:42 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105322
fixes bug(s): http://debbugs.gnu.org/9168
committer: Jan D. <address@hidden>
branch nick: trunk
timestamp: Mon 2011-07-25 23:49:42 +0200
message:
  * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
  are specified.
modified:
  src/ChangeLog
  src/nsmenu.m
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-07-25 16:39:39 +0000
+++ b/src/ChangeLog     2011-07-25 21:49:42 +0000
@@ -1,3 +1,8 @@
+2011-07-25  Jan Djärv  <address@hidden>
+
+       * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
+       are specified (Bug#9168).
+
 2011-07-25  Paul Eggert  <address@hidden>
 
        * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.

=== modified file 'src/nsmenu.m'
--- a/src/nsmenu.m      2011-07-08 10:04:23 +0000
+++ b/src/nsmenu.m      2011-07-25 21:49:42 +0000
@@ -1340,7 +1340,7 @@
 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 @@
   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];


reply via email to

[Prev in Thread] Current Thread [Next in Thread]