Is there a method via the API that I can use to will prevent a Fl_Input
widget (Value_Input, etc.) from losing focus?
I have a dialog box that contains a Fl_Input. The dialog box appears when a
button is pushed on the main window.
I would like the text in the Fl_Input to be selected which I do using
position(0, size()) method.
However, when the Fl_Input loses focus, say I click on a blank part of the
dialog box, the selection highlight disappears. I would like to prevent
this.
As a workaround (temporary I hope) is to add a handle() function to my
dialog box (It's a FLUID generated via Widget Class). I have this as my
int MyDialog::handle(int e)
{
switch(e)
{
case FL_FOCUS:
case FL_UNFOCUS:
textbox->take_focus(); <---- textbox is the Fl_Input
break;
}
return Fl_Double_Window::handle(e);
}
So far it works but I wonder if this will have undesirable side-effects? I
currently only have the one Fl_Input I will have to test with 2 or more.
Is there a better (as in more correct) way to do this?
--
Alvin
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk