class fltk::StyleSet


Fltk can manage "sets" of styles. This is useful for making a program that displays more than one "theme" at a time, such as a program that edits or creates themes. The "test" widgets can display the theme under development, while the main widgets stay unchanged. Fluid uses this to allow you to try your program under different themes.

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.

fltk::StyleSet::StyleSet()

The first fltk::StyleSet you create is made into the current one and is made equal to the current settings of the styles. All other style sets you create are set to a revert form of all the styles and you must call make_current on them to make them useful.

fltk::StyleSet::~StyleSet()

Currently this does nothing.

void fltk::StyleSet::make_current();

Make this set be current. All widgets created after this use this set, and calling fltk::Style::reload_theme() will change the styles belonging to tis set.