## class fltk::NamedStyle

#### fltk::NamedStyle(const char* name, void (*revert)(fltk::Style*), fltk::Style** pointer);

This subclass of `fltk::Style` creates a style that can be returned by fltk::Style::find(). It also provides a "revert" method that is used to restore the initial state so that themes can be switched.

name is the name you want themes to use to look up the style. If you don't care if themes can modify your class you can just use `NULL` for the name.

revert is a function that initializes the style to it's default value. The style is cleared to zero (meaning inherit from the default style) before revert is called. If revert is NULL then all-zeros is the default.

pointer is a back-pointer to the pointer to the style. This allows multiple themes to exist at once, if an application wants it (for instance a theme-editor application would like this). The application can change this pointer to point at different style structures and then all widgets that are constructed after that get the new style. If you don't plan to use your widget in such a program you can make a static instance of your style (rather than using new) and pass null as this pointer.

Here is an example of a class that wants the box to default to fltk::ROUND_BOX:

    static void revert(fltk::Style* s) {
      s->box = fltk::ROUND_BOX;
    }
    static fltk::NamedStyle* style = new fltk::NamedStyle("MyWidget", revert, &style);

    MyWidget::MyWidget(int x, int y, int w, int h, const char *l)
      : fltk::Widget(x,y,w,h,l)
    {
      style(::style);
    }