Go to the first, previous, next, last section, table of contents.
A button is an instance of the more general Selector
abstraction, so operations allowed on Selectors all apply to
buttons. Hide this fact though at the Button abstraction level and
rename the Selector operations:
button :: Picture -> a -> Component (Button a, DisplayHandle)
-
create button with arbitrary picture label. Each time the button is
clicked, the Button will emit the value given as second argument
to button.
Returns:
Button a
-
DisplayHandle
-
getButtonClick :: Button a -> IO a
-
get next click from the button.
setButtonLabel :: Button a -> Picture -> IO a
-
change the current label for the button.
combineButtons :: Button a -> IO (Button a)
-
merge a set of buttons together, such that button clicks that are
reported to any of the combined buttons are forwarded to the combined
button.
mapButton :: (a->b) -> Button a -> Button b
-
returns a new button which for every value output by an existing button
apply a function to its output.
disableButton :: Button a -> IO ()
-
disable interaction with the user.
enableButton :: Button a -> IO ()
-
if disabled, enable interaction again.
nameButton :: SelectorName -> Button a -> Button a
-
return a button value with a new name.
Go to the first, previous, next, last section, table of contents.