Each widget "belongs" to a set, which is assigned to the current set when the widget is constructed.
The actual implementation is to change the pointers such as fltk::Widget::default_style for every widget class to point to a new copy, so when the constructors for each widget are run they assign the new copy. The previous copies are saved and restored if the older set name is used.
There are some problems. Many widgets are dynamically created (for instance pop-up menus) and may not inherit the expected theme unless you are careful. Also some global things such as the background color cannot be seperated into sets.
Public Member Functions | |
void | make_current () |
StyleSet () | |
~StyleSet () |
|
The first StyleSet you create is made into the current one and is made equal to the current settings of the styles. All subsequent StyleSet are set to the Style::revert() version of the current ones, and you must call make_current() on them to make them useful. |
|
The destructor does nothing. It is not clear what it should do, as Widgets may still be using the styles. |
|
Make this set be current. All widgets created after this use this set, and calling fltk::reload_theme() will change the styles belonging to this set. |