From 6b491e331785b8a2c17ec17115dc478907f158d1 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Tue, 21 Jul 2015 12:48:08 +0000 Subject: Fix window resizing of common dialogs under certain rare conditions. The modified test program test/ask.cxx showed a problem that the active dialog window was resized when fl_message_icon() was called while it was open, because this call makeform() which resized the window. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10806 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/fl_ask.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fl_ask.cxx b/src/fl_ask.cxx index 7a62a9b43..7e7a24edb 100644 --- a/src/fl_ask.cxx +++ b/src/fl_ask.cxx @@ -73,7 +73,6 @@ static void button_cb(Fl_Widget *, long val) { static Fl_Window *makeform() { if (message_form) { - message_form->size(410,103); return message_form; } // make sure that the dialog does not become the child of some @@ -134,6 +133,8 @@ static void resizeform() { int x, w, h, max_w, max_h; const int icon_size = 50; + message_form->size(410,103); + fl_font(message->labelfont(), message->labelsize()); message_w = message_h = 0; fl_measure(message->label(), message_w, message_h); @@ -209,6 +210,7 @@ static int innards(const char* fmt, va_list ap, avoidRecursion = 1; makeform(); + message_form->size(410,103); char buffer[1024]; if (!strcmp(fmt,"%s")) { message->label(va_arg(ap, const char*)); @@ -469,6 +471,7 @@ Fl_Widget *fl_message_icon() {makeform(); return icon;} static const char* input_innards(const char* fmt, va_list ap, const char* defstr, uchar type) { makeform(); + message_form->size(410,103); message->position(60,10); input->type(type); input->show(); -- cgit v1.2.3