DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2591
Version: 1.3-current
Attached file button_order_2.patch fixes the focus issue, but I don't know
*why* it didn't work with the previous patch (it should, IMHO).
Obviously take_focus() only works as expected after the message window has
been show()n, when the patch is applied, but this doesn't make any sense
for me. Strange...
Anyway, I don't have more time to test now, please test and look for other
possible side effects.
Link: http://www.fltk.org/str.php?L2591
Version: 1.3-current
Index: src/fl_ask.cxx
===================================================================
--- src/fl_ask.cxx (Revision 8515)
+++ src/fl_ask.cxx (Arbeitskopie)
@@ -99,6 +99,7 @@
o->color(FL_WHITE);
o->labelcolor(FL_BLUE);
}
+ w->end(); // don't add the buttons automatically
// create the buttons (right to left)
for (int b=0, x=310; b<3; b++, x -= 100) {
if (b==1)
@@ -109,6 +110,10 @@
button[b]->callback(button_cb,(void *)b);
}
button[0]->shortcut(FL_Escape);
+ // add the buttons (left to right)
+ for (int b=2; b>=0; b--)
+ w->add(button[b]);
+ w->begin();
w->resizable(new Fl_Box(60,10,110-60,27));
w->end();
w->set_modal();
@@ -228,8 +233,6 @@
resizeform();
- if (button[1]->visible() && !input->visible())
- button[1]->take_focus();
if (enableHotspot)
message_form->hotspot(button[0]);
if (b0 && Fl_Widget::label_shortcut(b0))
@@ -245,6 +248,12 @@
Fl_Window* g = Fl::grab();
if (g) Fl::grab(0);
message_form->show();
+
+ if (input->visible())
+ input->take_focus();
+ else if (button[1]->visible())
+ button[1]->take_focus();
+
while (message_form->shown()) Fl::wait();
if (g) // regrab the previous popup menu, if there was one
Fl::grab(g);
_______________________________________________
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs