class fwt::Button

sys::Obj
  fwt::Widget
    fwt::Button

@Js
@Serializable

Source

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

Source

Command associated with this button. Setting the command automatically maps the text, icon, enable state, and eventing to the command.

font

Font? font

Source

Font for text. Defaults to null (system default).

image

Image? image

Source

Image to display on button. Defaults to null.

insets

const Insets insets := defInsets

Source

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)

Source

Default constructor.

makeCommand

new makeCommand(Command c, |This|? f := null)

Source

Make a button the specified command.

mode

const ButtonMode mode := ButtonMode.push

Source

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()

Source

Callback function when button is pressed or selection is changed.

Event id fired:

Event fields:

  • none
prefSize

virtual override Size prefSize(Hints hints := Hints.defVal)

Source

selected

Bool selected

Source

The button's selection state (if check, radio, or toggle). Defaults to false.

text

Str text

Source

Text of the button. Defaults to "".

toolTip

Str toolTip

Source

The button's tool tip. Defaults to "".