Greg Ercolano wrote:

> 
>       So, any resistance to an Fl_Widget::copy_properties() method?
>       ie:
> 
>               void Fl_Widget::copy_properties(const Fl_Widget*)
> 
>       ..which just copies fonts/colors/etc, similar to what fluid does?
> 

And what about a Fl_Style class - similar but simpler that in FLTK 2?

That would allow change property just by assigning a style pointer
(still copy possible) or making "dynamic style copy" if some widget
value is changed. Saves widget space too (one pointer instead of all the
colors, box, font, ...) for stock unmodified widgets and allows to
control appearance of widgets from single place.

One thing I do not like too much in fltk2 is deep recursive digging for
non-zero value which can be expensive for deep tree. Instead I would
link (probably double-link for fast attachment/removal of dynamic
styles) "brother" styles and add the first of them assign to the parent
so that parent can recursively update child styles right away. Bit flags
would indicate which style value was explicitly set/overridden by the
child itself and should not be updated by the parent style.

Just my 2 cents.

R.



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

Reply via email to