|
|
imm wrote:
> my_button->clear_visible_focus();
>
> Don't do this in the callback
Hmm, yeah, seems odd that doesn't work from the callback. Isn't documented:
http://fltk.org/documentation.php/doc-1.1/Fl_Widget.html#Fl_Widget.clear_visible_focus
Using the global Fl::visible_focus(0) works from the button's callback though.
Maybe one needs to manually 'throw focus' away from the widget for it to
take effect right away. (tries it) Hmm, yeah, that seems to work:
static void Button_CB(Fl_Widget* in, void*userdata) {
Fl_Button *but = (Fl_Button*)userdata;
but->clear_visible_focus();
Fl::focus(0); // this makes it take effect right away
}
[ Direct Link to Message ] | |
|
| |