wxRuby Documentation Home

Wx::ToggleButton

ToggleButton is a button that stays pressed when clicked by the user. In other words, it is similar to CheckBox in functionality but looks like a Button.

You can see ToggleButton in action in the sixth page of the controls sample.

NB: This class is not available under Universal ports such as X11.

Derived from

Control

Window

EvtHandler

Object

Window styles

There are no special styles for ToggleButton.

See also window styles overview.

Event handling

evt_togglebutton(id) { | event | ... } Handles a button click event.

See also

CheckBox, Button

Methods

ToggleButton.new

ToggleButton.new(Window parent,  Integer id,  String label, 
                 Point pos = DEFAULT_POSITION, 
                 Size size = DEFAULT_SIZE, 
                 Integer style = 0, 
                 Validator val, 
                 String name = "checkBox")

Constructor, creating and showing a toggle button.

Parameters

See also

ToggleButton#create, Validator

destructor()

Destructor, destroying the toggle button.

ToggleButton#create

Boolean create(Window parent,  Integer id,  String label, 
               Point pos = DEFAULT_POSITION, 
               Size size = DEFAULT_SIZE, 
               Integer style = 0, 
               Validator val, 
               String name = "checkBox")

Creates the toggle button for two-step construction. See ToggleButton.new for details.

ToggleButton#get_value

Boolean get_value()

Gets the state of the toggle button.

Return value

Returns true if it is pressed, false otherwise.

ToggleButton#set_value

set_value(Boolean state)

Sets the toggle button to the given state. This does not cause a EVT_TOGGLEBUTTON event to be emitted.

Parameters

[This page automatically generated from the Textile source at Wed Sep 09 02:21:28 +0100 2009]