changeset 53545:ed3e26153ee9

* xmenu.c (Fx_popup_dialog): Add an Ok button if no buttons are specified.
author Jan Djärv <jan.h.d@swipnet.se>
date Thu, 08 Jan 2004 21:04:32 +0000
parents 41011f848610
children 09fdb86bd84e
files src/ChangeLog src/xmenu.c
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Jan 08 12:20:43 2004 +0000
+++ b/src/ChangeLog	Thu Jan 08 21:04:32 2004 +0000
@@ -1,3 +1,8 @@
+2004-01-08  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* xmenu.c (Fx_popup_dialog): Add an Ok button if no buttons are
+	specified.
+
 2004-01-08  Kenichi Handa  <handa@m17n.org>
 
 	* editfns.c (Fformat): Fix '&' to '&&'.
--- a/src/xmenu.c	Thu Jan 08 12:20:43 2004 +0000
+++ b/src/xmenu.c	Thu Jan 08 21:04:32 2004 +0000
@@ -1092,6 +1092,12 @@
     CHECK_STRING (title);
     record_unwind_protect (unuse_menu_items, Qnil);
 
+    if (NILP (Fcar (Fcdr (contents))))
+      /* No buttons specified, add an "Ok" button so users can pop down
+         the dialog.  Also, the lesstif/motif version crashes if there are
+         no buttons.  */
+      contents = Fcons (title, Fcons (Fcons (build_string ("Ok"), Qt), Qnil));
+    
     list_of_panes (Fcons (contents, Qnil));
 
     /* Display them in a dialog box.  */