Each widget has a pointer to an instance of fltk::Style. Usually many widgets share pointers to the same fltk::Style. All the fltk::Styles are linked into a hierarchy of parents & child styles, so that it is possible to change an item in a parent style and propagate all the changes to the children.
When a widget looks up a value from a style, it looks at that style and each parent up until it finds a non-zero value to return, or until there are no more parents, in which case zero is used. Thus changing a parent style can make global changes as long as widgets do not have local values set.
In normal usage "set" methods like fltk::Widget::box(n) will create a "unique" style for that widget, which is a child of the original style, and set the box in that style. This "unique" style is reused for any other changes to that widget and it is deleted when the widget is deleted.
fltk::DOWN_BOX
.
fltk::UP_BOX
.
The default glyph function can draw these values for glyph:
fltk::GLYPH_UP
- draw an up arrow
fltk::GLYPH_UP_BUTTON
- draw an up arrow in a box
fltk::GLYPH_DOWN
- draw a down arrow
fltk::GLYPH_DOWN_BUTTON
- draw a down arrow in a box
fltk::GLYPH_LEFT
- draw a left arrow
fltk::GLYPH_LEFT_BUTTON
- draw a left arrow in a box
fltk::GLYPH_RIGHT
- draw a right arrow
fltk::GLYPH_RIGHT_BUTTON
- draw a right arrow in a box
scrollbar
If you wish to write your own glyph function you should examine the ones in the fltk source code and in the sample theme plugins to see how the arguments are interpreted.
fltk::HELVETICA
.
label_font
. Default is 12.
fltk::HELVETICA
.
text_font
. Checkboxes and some other widgets use
this to control the size of the glyph. Default is 12.
fltk::NORMAL_LABEL
.
fltk::WHITE
. This color
is inherited by text displays and browsers, most of the "gray" you see
is due to widgets like fltk::Group that default the color to gray, and
the fact that many parts of the interface are drawn with the
button_color described below.
If you want to change the overall color of all the gray parts of
the interface you want to call fltk::background(color)
instead, as this will set the entry for fltk::GRAY
and also
set the "gray ramp" so that the edges of buttons are the same color.
fltk::BLACK
.
highlight_color
. The
default of zero leaves the label_color
unchanged.
fltk::GRAY
.
Check and radio buttons use this to color in the glyph.
selection_color
. The
default is fltk::WHITE
.
This is a static method on fltk::Style. It returns the first style found that matches the name. Case is ignored and spaces and underscores are considered equivalent. If nothing matches NULL is returned.
Theme-setting code uses this to locate the styles it has to modify. Using a string to locate the styles serves several purposes: