All,

I'd like to know if there are more FLTK users who have the need
to track the widget that currently has the focus. If this was a
common problem, we could probably add something to FLTK to make
this easier. It's not easy with current FLTK methods, as can be
seen in the current discussion with the title "scroll to focus
in Fl_Scroll" in fltk.general.

<http://www.fltk.org/newsgroups.php?gfltk.general+Q%22scroll+to+focus+in+Fl_Scroll%22>


I could imagine something like a callback that could be called
whenever the current focus widget (Fl::focus()) changes. This
could be something like:

   Fl::register_focus[_tracking] (my_widget,callback,arg)

to register interest in focus changes. In this case, each focus
change would call the callback function like this:

   void callback (Fl_Widget *w, long or void * arg, Fl_Widget *focus)

The last argument is just to avoid calling Fl::focus() each time
the callback is called, but could also be removed. The first
argument would be the widget ("my_widget") the callback was
registered for (this could also be NULL, if my_widget was NULL
in the call to register_focus[...].

... or something like that ...

Any ideas, comments, wishes ?

Albrecht

_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to