wxRuby Documentation Home

# Wx::Control

This is the base class for a control or ``widget’’.

A control is generally a small window which processes user input and/or
displays one or more item of data.

## Derived from

Window

EvtHandler

Object

## See also

Validator

## Methods

- Control#command
- Control#get_label
- Control#get_label_text
- Control#set_label

### Control#command

command(%(arg-type)CommandEvent% event)

Simulates the effect of the user issuing a command to the item. See CommandEvent.

### Control#get_label

String get_label()

Returns the control’s text. Note that the returned string contains the
mnemonics (`&` characters) if any, use
Control#get_label_text if they are
undesired.

### Control#get_label_text

String get_label_text()

Returns the control’s label without the mnemonics characters.

Can also be called as a class method, passing in a single label string;
this will return the same label string with the mnemonic characters removed.

### Control#set_label

set_label(%(arg-type)String% label)

Sets the item’s text. The `&` characters in the label are special and
indicate that the following character is a mnemonic for this control and
can be used to activate it from the keyboard (typically by using Alt key
in combination with it). To insert a literal ampersand character, you need to double it, i.e. use `"&&"`

[This page automatically generated from the Textile source at 2023-06-09 00:45:31 +0000]