To solve STR#2939 "Fl_Tabs not honoring when(FL_WHEN_NOT_CHANGED)"
noticed that Fl_Tabs doesn't really make use of when() at all.

It seems to me tabs are very much like radio buttons, so it seems
it would make sense to model Fl_Tabs handling of when() after radio button's.

With radio buttons, the behavior is:

   0) FL_WHEN_NEVER                       -- callback never invoked
   1) FL_WHEN_CHANGED                     -- invokes callback when click 
changes a button's state (no callback if no change)
   2) FL_WHEN_NOT_CHANGED                 -- invokes callback when click 
/doesn't/ change a button's state (no callback if change)
   3) FL_WHEN_CHANGED|FL_WHEN_NOT_CHANGED -- invokes callback when clicked if 
button changes state or not
   4) FL_WHEN_RELEASED                    -- if none of the above are set, 
callback invoked if button's state changes

In all cases, changed() reflects if a button changed state or not
(Fl_Tabs does this as well)

And like radio buttons, Fl_Tab's default when() value is FL_WHEN_RELEASED,
so the default behavior would be the same as it is now with that default.

Anyone see a problem with implementing this into Fl_Tabs?
I don't think there'd be any backwards compatible issues, and apps to date
shouldn't be messing with when() as to date behavior is not documented.
However, it may be prudent to protect the above 'new' behavior with a
macro (like FL_ABI_VERSION, or some such) if that might be an issue..
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to