fltk::Button Class Reference

Inherits fltk::Widget.

Inherited by BButton, fltk::CheckButton, fltk::HighlightButton, fltk::RepeatButton, fltk::ReturnButton, and fltk::ToggleButton.

List of all members.

Public Types

enum  { HIDDEN }

Public Member Functions

 Button (int, int, int, int, const char *=0)
void draw (int glyph_width) const
virtual void draw ()
int handle (int event, const Rectangle &)
int handle (int)
bool value (bool v)
bool value () const

Static Public Attributes

static NamedStyledefault_style


Detailed Description

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

Buttons can also generate callbacks in response to fltk::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 fltk::KEY event.

buttons.gif

Member Function Documentation

bool Button::value (  )  const [inline]

The current value. True means it is pushed down, false means it is not pushed down. The ToggleButton subclass provides the ability for the user to change this value permanently, otherwise it is just temporary while the user is holding the button down.

This is the same as Widget::state().

bool Button::value ( bool  v  )  [inline]

Change the value(). Redraws the button and returns true if the new value is different. This is the same function as Widget::state(). See also Widget::set(), Widget::clear(), and Widget::setonly().

If you turn it on, a normal button will draw pushed-in, until the user clicks it and releases it.

void Button::draw ( int  glyph_width  )  const


Wed Jun 17 08:58:24 2009. FLTK ©2007 Bill Spitzak and others.
Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.