Fltk Buttons

Buttons generate callbacks when they are clicked by the user. You control exactly when and how by changing the values for type() and when().

Buttons can also generate callbacks in response to FL_SHORTCUT events. The button can either have an explicit shortcut() value or a letter shortcut can be indicated in the label() with an '&' character before it. For the label shortcut it does not matter if Alt is held down, but if you have an input field in the same window, the user will have to hold down the Alt key so that the input field does not eat the event first as an FL_KEYBOARD event.

Besides the base class there are some useful subclasses defined:

class Fl_Button : public Fl_Widget

Fl_Button::Fl_Button(int,int,int,int,const char * = 0);

uchar Fl_Button::type() const;
void Fl_Button::type(uchar);

Fl_When Fl_Widget::when() const;
void Fl_Widget::when(Fl_When);

char Fl_Button::value() const;

int Fl_Button::value(int);
int Fl_Button::set();
int Fl_Button::clear();

void Fl_Button::setonly();

Fl_Boxtype Fl_Button::down_box() const;
void Fl_Button::down_box(Fl_Boxtype);

ulong Fl_Button::shortcut() const;
void Fl_Button::shortcut(ulong);