From: Jan Djärv Date: Thu, 8 Jan 2004 21:04:32 +0000 (+0000) Subject: * xmenu.c (Fx_popup_dialog): Add an Ok button if no buttons are X-Git-Tag: ttn-vms-21-2-B4~7968 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=160b1b50f97a0a020c40eda4762e2d7e06c11df9;p=emacs.git * xmenu.c (Fx_popup_dialog): Add an Ok button if no buttons are specified. --- diff --git a/src/ChangeLog b/src/ChangeLog index 44d922a254e..27c76179e57 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-01-08 Jan Dj,Ad(Brv + + * xmenu.c (Fx_popup_dialog): Add an Ok button if no buttons are + specified. + 2004-01-08 Kenichi Handa * editfns.c (Fformat): Fix '&' to '&&'. diff --git a/src/xmenu.c b/src/xmenu.c index 669d8177c15..439f5002dde 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1092,6 +1092,12 @@ on the left of the dialog box and all following items on the right. 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. */