class fwt::Button
sys::Obj fwt::Widget fwt::Button
Button displays a push, toggle, check, or radio button with text and/or an image. Buttons can also be used as the children of a ToolBar
.
- command
-
Command? command
Command associated with this button. Setting the command automatically maps the text, icon, enable state, and eventing to the command.
- font
-
Font? font
Font for text. Defaults to null (system default).
- image
-
Image? image
Image to display on button. Defaults to null.
- insets
-
const Insets insets := defInsets
Insets to apply for padding between the button's border and its image and text. Insets are only applied to push and toggle butttons; they are not applied to checks, radio, sep, or toolbar buttons.
- make
-
new make(|This|? f := null)
Default constructor.
- makeCommand
-
new makeCommand(Command c, |This|? f := null)
Make a button the specified command.
- mode
-
const ButtonMode mode := ButtonMode.push
Button mode defines the style: check, push, radio, or toggle. If the button is a child of a ToolBar then you can also use sep and check/toggle have same behavior. Radio buttons are grouped by separator in a ToolBar. The default is push. This field cannot be changed once the button is constructed.
- onAction
-
EventListeners onAction()
Callback function when button is pressed or selection is changed.
Event id fired:
Event fields:
- none
- prefSize
- selected
-
Bool selected
The button's selection state (if check, radio, or toggle). Defaults to false.
- text
-
Str text
Text of the button. Defaults to "".
- toolTip
-
Str toolTip
The button's tool tip. Defaults to "".