As buttons are intended to show the user how to initiate some action,
they are often labeled as commands. Additionally, if the action is not
currently possible given the state of the GUI, a button is typically
disabled. This can be done through the enabled
method.
The svalue()
method returns the value of the
widget. For a button, this is the text as a single string
(which may not include a "\n" for newlines if not supported by
the toolkit).
The svalue<-
method can be used to set the text of
the widget. For buttons, values with length greater
than one are pasted together collapsed with "\n".
The addHandlerChanged
method is aliased to the
addHandlerClicked
method which can be used to set a
handler to respond to click events.
When the action
argument is a gaction
instance, then
the button label and handler will be derived from the gaction
instance. The enabled<-
method of the gaction
instance
should be used to set the sensitivity to user input, not the
enabled<-
method of the gbutton
instance.