| ||||||||||||||
| ||||||||||||||
| ||||||||||||||
Description | ||||||||||||||
A widget that creates a signal when clicked on | ||||||||||||||
Synopsis | ||||||||||||||
Detail | ||||||||||||||
The Button widget is generally used to attach a function to that is called when the button is pressed. The various signals and how to use them are outlined below. The Button widget can hold any valid child widget. That is it can hold most any other standard Widget. The most commonly used child is the Label. | ||||||||||||||
Class Hierarchy | ||||||||||||||
| GObject | +----Object | +----Widget | +----Container | +----Bin | +----Button | +----ToggleButton | +----ColorButton | +----FontButton | +----OptionMenu | ||||||||||||||
Types | ||||||||||||||
data Button | ||||||||||||||
| ||||||||||||||
class BinClass o => ButtonClass o | ||||||||||||||
| ||||||||||||||
castToButton :: GObjectClass obj => obj -> Button | ||||||||||||||
toButton :: ButtonClass o => o -> Button | ||||||||||||||
Constructors | ||||||||||||||
buttonNew :: IO Button | ||||||||||||||
Creates a new Button widget. To add a child widget to the button, use containerAdd. | ||||||||||||||
buttonNewWithLabel | ||||||||||||||
| ||||||||||||||
buttonNewWithMnemonic | ||||||||||||||
| ||||||||||||||
buttonNewFromStock | ||||||||||||||
| ||||||||||||||
Methods | ||||||||||||||
buttonPressed :: ButtonClass self => self -> IO () | ||||||||||||||
Emits the button pressed signal for the given Button. | ||||||||||||||
buttonReleased :: ButtonClass self => self -> IO () | ||||||||||||||
Emits the button released signal for the given Button. | ||||||||||||||
buttonClicked :: ButtonClass self => self -> IO () | ||||||||||||||
Emits the button clicked signal for the given Button. This is similar to calling buttonPressed and buttonReleased in sequence. | ||||||||||||||
buttonEnter :: ButtonClass self => self -> IO () | ||||||||||||||
Emit the cursor enters signal to the button. | ||||||||||||||
buttonLeave :: ButtonClass self => self -> IO () | ||||||||||||||
Emit the cursor leaves signal to the button. | ||||||||||||||
data ReliefStyle | ||||||||||||||
| ||||||||||||||
buttonSetRelief | ||||||||||||||
| ||||||||||||||
buttonGetRelief | ||||||||||||||
| ||||||||||||||
buttonSetLabel :: ButtonClass self => self -> String -> IO () | ||||||||||||||
Sets the text of the label of the button. This text is also used to select the stock item if buttonSetUseStock is used. This will also clear any previously set labels. | ||||||||||||||
buttonGetLabel :: ButtonClass self => self -> IO String | ||||||||||||||
Gets the text from the label of the button, as set by buttonSetLabel. If the label text has not been set the return value will be "". This will be the case if you create an empty button with buttonNew to use as a container. | ||||||||||||||
buttonSetUseStock | ||||||||||||||
| ||||||||||||||
buttonGetUseStock | ||||||||||||||
| ||||||||||||||
buttonSetUseUnderline | ||||||||||||||
| ||||||||||||||
buttonGetUseUnderline | ||||||||||||||
| ||||||||||||||
buttonSetFocusOnClick | ||||||||||||||
| ||||||||||||||
buttonGetFocusOnClick | ||||||||||||||
| ||||||||||||||
buttonSetAlignment | ||||||||||||||
| ||||||||||||||
buttonGetAlignment | ||||||||||||||
| ||||||||||||||
buttonGetImage | ||||||||||||||
| ||||||||||||||
buttonSetImage | ||||||||||||||
| ||||||||||||||
Attributes | ||||||||||||||
buttonLabel :: ButtonClass self => Attr self String | ||||||||||||||
Text of the label widget inside the button, if the button contains a label widget. Default value: "" | ||||||||||||||
buttonUseUnderline :: ButtonClass self => Attr self Bool | ||||||||||||||
If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key. Default value: False | ||||||||||||||
buttonUseStock :: ButtonClass self => Attr self Bool | ||||||||||||||
If set, the label is used to pick a stock item instead of being displayed. Default value: False | ||||||||||||||
buttonFocusOnClick :: ButtonClass self => Attr self Bool | ||||||||||||||
Whether the button grabs focus when it is clicked with the mouse. Default value: True | ||||||||||||||
buttonRelief :: ButtonClass self => Attr self ReliefStyle | ||||||||||||||
The border relief style. Default value: ReliefNormal | ||||||||||||||
buttonXalign :: ButtonClass self => Attr self Float | ||||||||||||||
If the child of the button is a Misc or Alignment, this property can be used to control it's horizontal alignment. 0.0 is left aligned, 1.0 is right aligned. Allowed values: [0,1] Default value: 0.5 | ||||||||||||||
buttonYalign :: ButtonClass self => Attr self Float | ||||||||||||||
If the child of the button is a Misc or Alignment, this property can be used to control it's vertical alignment. 0.0 is top aligned, 1.0 is bottom aligned. Allowed values: [0,1] Default value: 0.5 | ||||||||||||||
buttonImage :: (ButtonClass self, WidgetClass image) => ReadWriteAttr self (Maybe Widget) image | ||||||||||||||
Child widget to appear next to the button text.
| ||||||||||||||
Signals | ||||||||||||||
onButtonActivate :: ButtonClass b => b -> IO () -> IO (ConnectId b) | ||||||||||||||
The button has been depressed (but not necessarily released yet). See clicked signal. | ||||||||||||||
afterButtonActivate :: ButtonClass b => b -> IO () -> IO (ConnectId b) | ||||||||||||||
onClicked :: ButtonClass b => b -> IO () -> IO (ConnectId b) | ||||||||||||||
The button was clicked. This is only emitted if the mouse cursor was over the button when it was released. | ||||||||||||||
afterClicked :: ButtonClass b => b -> IO () -> IO (ConnectId b) | ||||||||||||||
onEnter :: ButtonClass b => b -> IO () -> IO (ConnectId b) | ||||||||||||||
The cursor enters the button box. | ||||||||||||||
afterEnter :: ButtonClass b => b -> IO () -> IO (ConnectId b) | ||||||||||||||
onLeave :: ButtonClass b => b -> IO () -> IO (ConnectId b) | ||||||||||||||
The cursor leaves the button box. | ||||||||||||||
afterLeave :: ButtonClass b => b -> IO () -> IO (ConnectId b) | ||||||||||||||
onPressed :: ButtonClass b => b -> IO () -> IO (ConnectId b) | ||||||||||||||
The button is pressed. | ||||||||||||||
afterPressed :: ButtonClass b => b -> IO () -> IO (ConnectId b) | ||||||||||||||
onReleased :: ButtonClass b => b -> IO () -> IO (ConnectId b) | ||||||||||||||
The button is released. | ||||||||||||||
afterReleased :: ButtonClass b => b -> IO () -> IO (ConnectId b) | ||||||||||||||
Produced by Haddock version 0.8 |