From 160b1b50f97a0a020c40eda4762e2d7e06c11df9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 8 Jan 2004 21:04:32 +0000 Subject: [PATCH] * xmenu.c (Fx_popup_dialog): Add an Ok button if no buttons are specified. --- src/ChangeLog | 5 +++++ src/xmenu.c | 6 ++++++ 2 files changed, 11 insertions(+) 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. */ -- 2.39.2