Name

Button —

Synopsis

buttonNew:: IO Button
buttonNewFromStock:: String -> IO Button
buttonNewWithLabel:: String -> IO Button
buttonNewWithMnemonic:: String -> IO Button
buttonClicked:: ButtonClass b => b -> IO ()
buttonEnter:: ButtonClass b => b -> IO ()
buttonGetLabel:: ButtonClass b => b -> IO String
buttonGetRelief:: ButtonClass b => b -> IO ReliefStyle
buttonGetUseStock:: ButtonClass b => b -> IO Bool
buttonGetUseUnderline:: ButtonClass b => b -> IO Bool
buttonLeave:: ButtonClass b => b -> IO ()
buttonPressed:: ButtonClass b => b -> IO ()
buttonReleased:: ButtonClass b => b -> IO ()
buttonSetLabel:: ButtonClass b => b -> String -> IO ()
buttonSetRelief:: ButtonClass b => b -> ReliefStyle -> IO ()
buttonSetUseStock:: ButtonClass b => b -> Bool -> IO ()
buttonSetUseUnderline:: ButtonClass b => b -> Bool -> IO ()
onButtonActivate:: ButtonClass b => b -> IO () -> IO (ConnectId b)
onClicked:: ButtonClass b => b -> IO () -> IO (ConnectId b)
onEnter:: ButtonClass b => b -> IO () -> IO (ConnectId b)
onLeave:: ButtonClass b => b -> IO () -> IO (ConnectId b)
onPressed:: ButtonClass b => b -> IO () -> IO (ConnectId b)
onReleased:: ButtonClass b => b -> IO () -> IO (ConnectId b)

Constructors

buttonNew

Create a new Button widget.

buttonNew

buttonNewFromStock

Create a stock (predefined appearance) button.

buttonNewFromStock:: String:: IO Button
stockId

buttonNewWithLabel

Create a button with a label in it.

buttonNewWithLabel:: String:: IO Button
lbl

buttonNewWithMnemonic

Create a button with an accelerator key.

buttonNewWithMnemonic:: String:: IO Button
lbl

Like buttonNewWithLabel but turns every underscore in the label to a underlined character which then acts as a mnemonic (keyboard shortcut).

Methods

buttonClicked

Emit the clicked signal on the button.

buttonClicked:: b:: IO ()
b

This is similar to calling buttonPressed and buttonReleased in sequence.

buttonEnter

Emit the cursor enters signal to the button.

buttonEnter:: b:: IO ()
b

buttonGetLabel

Get the current text on the button.

buttonGetLabel:: b:: IO String
b

The method returns the empty string in case the button does not have a label (e.g. it was created with buttonNew.

buttonGetRelief

Get the current relief style.

buttonGetRelief:: b:: IO ReliefStyle
b

buttonGetUseStock

Get the current flag for stock lookups.

buttonGetUseStock:: b:: IO Bool
b

buttonGetUseUnderline

Query if the underlines are mnemonics.

buttonGetUseUnderline:: b:: IO Bool
b

buttonLeave

Emit the cursor leaves signal to the button.

buttonLeave:: b:: IO ()
b

buttonPressed

Depress the button, i.e. emit the pressed signal.

buttonPressed:: b:: IO ()
b

buttonReleased

Release the button, i.e. emit the released signal.

buttonReleased:: b:: IO ()
b

buttonSetLabel

Set the text of the button.

buttonSetLabel:: b:: String:: IO ()
blbl

buttonSetRelief

Set the style of the button edges.

buttonSetRelief:: b:: ReliefStyle:: IO ()
brs

buttonSetUseStock

Set if the label is a stock identifier.

buttonSetUseStock:: b:: Bool:: IO ()
bflag

Setting this property to True will make the button lookup its label in the table of stock items. If there is a match, the button will use the stock item instead of the label. You need to set this flag before you change the label.

buttonSetUseUnderline

Set if the label has accelerators.

buttonSetUseUnderline:: b:: Bool:: IO ()
bflag

Setting this property will make the button join any underline character into the following letter and inserting this letter as a keyboard shortcut. You need to set this flag before you change the label.

Signals

onButtonActivate

The button has been depressed (but not necessarily released yet). See clicked signal.

onButtonActivate:: b:: IO ():: IO (ConnectId b)

onClicked

The button was clicked. This is only emitted if the mouse cursor was over the button when it was released.

onClicked:: b:: IO ():: IO (ConnectId b)

onEnter

The cursor enters the button box.

onEnter:: b:: IO ():: IO (ConnectId b)

onLeave

The cursor leaves the button box.

onLeave:: b:: IO ():: IO (ConnectId b)

onPressed

The button is pressed.

onPressed:: b:: IO ():: IO (ConnectId b)

onReleased

The button is released.

onReleased:: b:: IO ():: IO (ConnectId b)