|
Graphics.UI.Gtk.Buttons.Button | Portability | portable (depends on GHC) | Stability | provisional | Maintainer | gtk2hs-users@lists.sourceforge.net |
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
Constructors
|
|
|
Creates a new Button widget. To add a child widget to the button, use
Graphics.UI.Gtk.Abstract.Container.containerAdd.
|
|
|
|
|
|
:: String | label - The text of the button, with an underscore in
front of the mnemonic character
| -> IO Button | | Creates a new Button containing a label. If characters in label are
preceded by an underscore, they are underlined. If you need a literal
underscore character in a label, use '__' (two underscores). The first
underlined character represents a keyboard accelerator called a mnemonic.
Pressing Alt and that key activates the button.
|
|
|
|
:: StockId | stockId - the name of the stock item
| -> IO Button | | Creates a new Button containing the image and text from a stock item.
If stockId is unknown, then it will be treated as a mnemonic label (as
for buttonNewWithMnemonic).
|
|
|
Methods
|
|
|
Emits the button pressed signal for the given Button.
|
|
|
Emits the button released signal for the given Button.
|
|
|
Emits the button clicked signal for the given Button.
This is similar to calling buttonPressed and buttonReleased in sequence.
|
|
|
Emit the cursor enters signal to the button.
|
|
|
Emit the cursor leaves signal to the button.
|
|
|
I don't have a clue.
| Constructors | ReliefNormal | | ReliefHalf | | ReliefNone | |
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
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.
|
|
|
:: ButtonClass self | | => self | useStock - True if the button should use a stock item
| -> Bool | | -> IO () | | If true, the label set on the button is used as a stock id to select the
stock item for the button.
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.
|
|
|
|
:: ButtonClass self | | => self | returns True if the button label is used to select a stock
item instead of being used directly as the label text.
| -> IO Bool | | Returns whether the button label is a stock item.
|
|
|
|
:: ButtonClass self | | => self | useUnderline - True if underlines in the text indicate
mnemonics
| -> Bool | | -> IO () | | If true, an underline in the text of the button label indicates the next
character should be used for the mnemonic accelerator key.
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.
|
|
|
|
:: ButtonClass self | | => self | returns True if an embedded underline in the button label
indicates the mnemonic accelerator keys.
| -> IO Bool | | Returns whether an embedded underline in the button label indicates a
mnemonic. See buttonSetUseUnderline.
|
|
|
|
:: ButtonClass self | | => self | focusOnClick - whether the button grabs focus when clicked
with the mouse
| -> Bool | | -> IO () | | Sets whether the button will grab focus when it is clicked with the
mouse. Making mouse clicks not grab focus is useful in places like toolbars
where you don't want the keyboard focus removed from the main area of the
application.
- Available since Gtk version 2.4
|
|
|
|
:: ButtonClass self | | => self | returns True if the button grabs focus when it is clicked
with the mouse.
| -> IO Bool | | Returns whether the button grabs focus when it is clicked with the mouse.
See buttonSetFocusOnClick.
- Available since Gtk version 2.4
|
|
|
|
:: ButtonClass self | | => self | (xalign, yalign) - the horizontal position of the
child (0.0 is left aligned, 1.0 is right aligned) and
the vertical position of the child (0.0 is top aligned,
1.0 is bottom aligned)
| -> (Float, Float) | | -> IO () | | Sets the alignment of the child. This has no effect unless the child
derives from Misc or Alignment.
- Available since Gtk version 2.4
|
|
|
|
:: ButtonClass self | | => self | (xalign, yalign) - horizontal and vertical
alignment
| -> IO (Float, Float) | | Gets the alignment of the child in the button.
- Available since Gtk version 2.4
|
|
|
|
|
|
|
:: (ButtonClass self, WidgetClass image) | | => self | a widget to set as the image for the button
| -> image | | -> IO () | | Set the image of the button to the given widget. Note that it depends on
the "gtk-button-images" setting whether the image will be displayed or not.
- Available since Gtk+ version 2.6
|
|
|
|
Position a scale's value is drawn relative to the
trough
| Constructors | PosLeft | | PosRight | | PosTop | | PosBottom | |
|
|
|
|
:: ButtonClass self | | => self | position - the position
| -> PositionType | | -> IO () | | Sets the position of the image relative to the text inside the button.
- Available since Gtk+ version 2.10
|
|
|
|
:: ButtonClass self | | => self | returns the position
| -> IO PositionType | | Gets the position of the image relative to the text inside the button.
- Available since Gtk+ version 2.10
|
|
|
Attributes
|
|
|
Text of the label widget inside the button, if the button contains a
label widget.
Default value: ""
|
|
|
If set, an underline in the text indicates the next character should be
used for the mnemonic accelerator key.
Default value: False
|
|
|
If set, the label is used to pick a stock item instead of being
displayed.
Default value: False
|
|
|
Whether the button grabs focus when it is clicked with the mouse.
Default value: True
|
|
|
The border relief style.
Default value: ReliefNormal
|
|
|
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
|
|
|
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
|
|
|
Child widget to appear next to the button text.
- Available since Gtk version 2.6
|
|
|
The position of the image relative to the text inside the button.
Default value: PosLeft
- Available since Gtk+ version 2.10
|
|
Signals
|
|
|
Emitted when the button has been activated (pressed and released).
|
|
Deprecated
|
|
|
|
|
The button has been depressed (but not
necessarily released yet). See clicked signal.
|
|
|
|
|
The button was clicked. This is only emitted if
the mouse cursor was over the button when it was released.
|
|
|
|
|
The cursor enters the button box.
|
|
|
|
|
The cursor leaves the button box.
|
|
|
|
|
The button is pressed.
|
|
|
|
|
The button is released.
|
|
Produced by Haddock version 2.6.0 |