class
Button


Known Subclasses:  Column, DropDown, Toggle

General purpose push button that supports both text and icon as well as repeat event dispatching

Composite children

IdTypeStyle NameNotes
button-labelhaxe.ui.components.Label.labelThe text of the button (if applicable)
button-iconhaxe.ui.components.Image.iconThe icon of the button (if applicable)


Pseudo classes

NameNotes
:hoverThe style to be applied when the cursor is over the button
:downThe style to be applied when a mouse button is pressed inside the button
:activeThe style to be applied when the button has focus
:disabledThe style to be applied when the button is disabled


XML example

<button text="Button" styleNames="myCustomButton" style="font-size: 30px" onClick="trace('hello world')" />


Code example

var button = new Button(); button.text = "Button"; button.styleNames = "myCustomButton"; button.fontSize = 30; button.onClick = function(e) { trace("hello world"); }




behaviour
bindable
clonable
componentGroup:String
behaviour
bindable
clonable
easeInRepeater:Bool
Whether this button will ease in to specified repeatInterval
behaviour
bindable
clonable
icon:Variant
The image resource to use as the buttons icon
behaviour
bindable
clonable
remainPressed:Bool
Whether the buttons state should remain pressed even when the mouse has left its bounds
behaviour
bindable
clonable
repeatInterval:Int
How often this button will dispatch multiple click events while the the mouse is
pressed within it, in milliseconds. Default is 100.
behaviour
bindable
clonable
repeater:Bool
Whether this button will dispatch multiple click events while the the mouse is pressed within it
behaviour
bindable
clonable
selected:Bool
Whether this button is toggled or not (only relevant if toggle = true)
behaviour
bindable
clonable
toggle:Bool
Whether this button should behave as a toggle button or not
(a button that behaves like a switch, being either on/off)


override
cloneComponent():Button


style
fontSize:Null<Float>
style
iconPosition:String
style
textAlign:String