Websites Navigation: Airbit | Shop | m-shell.net
Languages: EN | DE

Class abgui.Button

is abgui.Label is abguibase.Widget
Known direct subclasses: abgui.RadioButton
A button showing text and calling its listeners when clicked.

Constructor

function init(text=, align=LEFT|VCENTER)
Overridesabgui.Label.init()
Initialize a new button.
Parameters:
text – the text to show in the button.
align – the horizontal and vertical alignment flags.

Fields

clickedBg The background for the clicked state.
listeners The listeners
normalBg The background for the normal state.

Functions

addListener(l) Add a listener.
doClick() Perform a button click, i.e. notify the listeners.
draw() Draw the button.
focusable() A Button is focusable.
handled(event) Handle keystrokes and clicking via the pointer.
removeListener(l) Remove a listener.
function focusable()
Overridesabguibase.Widget.focusable()
A Button is focusable.
Returns:true
function addListener(l)
Add a listener. This must be a function reference or an instance function reference, taking the argument (this).
Parameters:
l – the listener to add.
function removeListener(l)
Remove a listener.
Parameters:
l – the listener to remove.
function doClick()
Perform a button click, i.e. notify the listeners.
function draw()
Overridesabgui.Label.draw()
Draw the button.
function handled(event)
Overridesabguibase.Widget.handled()
Handle keystrokes and clicking via the pointer.
Parameters:
event – the event.
Returns:true if the event was handled.
mShell Home  > Documentation  > mdoc