Go to the first, previous, next, last section, table of contents.

ToggleButton Interface description

A button is an instance of the more general Toggle abstraction, so operations allowed on Toggles all apply to buttons:

* toggleButton :: Picture -> Picture -> Component (Toggle Bool, DisplayHandle)
create a flip-flop toggle button with arbitrary labels for the on and off state. Each time the toggle is clicked, the Toggle will emit a boolean value to indicate its pressed state

* getToggleClick :: Toggle a -> IO a
get the current state of the toggle.

* waitToggleClick :: Toggle a -> IO a
block until the toggle state changes.

* setToggleLabel :: Toggle a -> Bool -> Picture -> IO a
change the current label for the toggle.

* combineToggles :: [Toggle a] -> IO (Toggle [a])
merge a set of toggles together, such that clicks that are reported to any of the component toggles are forwarded to the combined toggle.

* mapToggle :: (a->b) -> (b->a) -> Toggle a -> Toggle b
* mapIOToggle :: (a-> IO b) -> (b->a) -> Toggle a -> Toggle b
returns a new toggle that for every value output by an existing button apply a function to its output.

* disableToggle :: Toggle a -> IO ()
* enableToggle :: Toggle a -> IO ()
disable or enable interaction with the user.

* setToggleName :: ToggleName -> Toggle a -> Toggle a
return the toggle value with a new name associated with it.

Go to the first, previous, next, last section, table of contents.