Boris Mayer-St-Onge wrote:
> I have an Fl_Input widget and I would like to execute a different 
> function depending if :
> 
> 1- the text is changed by the user or;
> 2- the text is changed AND if the widget loses the focus.
> 
> If I use when->(FL_WHEN_CHANGED), my callback will be executed if the 
> text is changed.
> 
> If I use when->(FL_WHEN_RELEASE), my callback will be executed if the 
> text is changed and the widget loses the focus.
> 
> How can I manage both? I tried when->(FL_WHEN_CHANGED|FL_WHEN_RELEASE), 
> but how to know from which events the callback as been called 
> (FL_WHEN_CHANGED or FL_WHEN_RELEASE). I sure there is a simple solution 
> but I haven't find the answer.

Ok, I reply to myself. I found the function Fl::focus() that can be used 
to know if the widget has lost the focus. Everything run as expected now.

Boris
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to