fltk::StyleSet Class Reference

List of all members.

Public Member Functions

void make_current ()
 StyleSet ()
 ~StyleSet ()

Detailed Description

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.


Constructor & Destructor Documentation

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.

StyleSet::~StyleSet ( )

The destructor does nothing. It is not clear what it should do, as Widgets may still be using the styles.


Member Function Documentation

void StyleSet::make_current ( )

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.


The documentation for this class was generated from the following files: