GtkButton {RGtk2}R Documentation

GtkButton

Description

A widget that creates a signal when clicked on

Methods and Functions

gtkButtonNew(show = TRUE)
gtkButtonNewWithLabel(label, show = TRUE)
gtkButtonNewWithMnemonic(label, show = TRUE)
gtkButtonNewFromStock(stock.id, show = TRUE)
gtkButtonPressed(object)
gtkButtonReleased(object)
gtkButtonClicked(object)
gtkButtonEnter(object)
gtkButtonLeave(object)
gtkButtonSetRelief(object, newstyle)
gtkButtonGetRelief(object)
gtkButtonGetLabel(object)
gtkButtonSetLabel(object, label)
gtkButtonGetUseStock(object)
gtkButtonSetUseStock(object, use.stock)
gtkButtonGetUseUnderline(object)
gtkButtonSetUseUnderline(object, use.underline)
gtkButtonSetFocusOnClick(object, focus.on.click)
gtkButtonGetFocusOnClick(object)
gtkButtonSetAlignment(object, xalign, yalign)
gtkButtonGetAlignment(object)
gtkButtonSetImage(object, image)
gtkButtonGetImage(object)
gtkButtonSetImagePosition(object, position)
gtkButtonGetImagePosition(object)
gtkButton(label, stock.id, show = TRUE)

Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----GtkButton
                                       +----GtkToggleButton
                                       +----GtkColorButton
                                       +----GtkFontButton
                                       +----GtkLinkButton
                                       +----GtkOptionMenu
                                       +----GtkScaleButton

Interfaces

GtkButton implements GtkBuildable and AtkImplementorIface.

Detailed Description

The GtkButton 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 GtkButton widget can hold any valid child widget. That is it can hold most any other standard GtkWidget. The most commonly used child is the GtkLabel.

Structures

GtkButton
This should not be accessed directly. Use the accessor functions below.

Convenient Construction

gtkButton is the result of collapsing the constructors of GtkButton (gtkButtonNew, gtkButtonNewWithLabel, gtkButtonNewFromStock, gtkButtonNewWithMnemonic) and accepts a subset of its arguments matching the required arguments of one of its delegate constructors.

Signals

The (widget, user.data)
The ::activate signal on GtkButton is an action signal and emitting it causes the button to animate press then release. Applications should never connect to this signal, but use the gtkButtonClicked signal.

widget
[GtkButton] the object which received the signal.
user.data
[R object] user data set when the signal handler was connected.

The (button, user.data)
Emitted when the button has been activated (pressed and released).

button
[GtkButton] the object that received the signal
user.data
[R object] user data set when the signal handler was connected.

The (button, user.data)
Emitted when the pointer enters the button.

Deprecated: Use the ::enter-notify-event signal.

button
[GtkButton] the object that received the signal
user.data
[R object] user data set when the signal handler was connected.

The (button, user.data)
Emitted when the pointer leaves the button.

Deprecated: Use the ::leave-notify-event signal.

button
[GtkButton] the object that received the signal
user.data
[R object] user data set when the signal handler was connected.

The (button, user.data)
Emitted when the button is pressed.

Deprecated: Use the ::button-press-event signal.

button
[GtkButton] the object that received the signal
user.data
[R object] user data set when the signal handler was connected.

The (button, user.data)
Emitted when the button is released.

Deprecated: Use the ::button-release-event signal.

button
[GtkButton] the object that received the signal
user.data
[R object] user data set when the signal handler was connected.

Properties

focus-on-click [logical : Read / Write]

Whether the button grabs focus when it is clicked with the mouse. Default value: TRUE

image [GtkWidget : Read / Write]

Child widget to appear next to the button text.

image-position [GtkPositionType : Read / Write]

The position of the image relative to the text inside the button.

Default value: GTK_POS_LEFT Since 2.10

label [character : Read / Write / Construct]

Text of the label widget inside the button, if the button contains a label widget. Default value: NULL

relief [GtkReliefStyle : Read / Write]

The border relief style. Default value: GTK_RELIEF_NORMAL

use-stock [logical : Read / Write / Construct]

If set, the label is used to pick a stock item instead of being displayed. Default value: FALSE

use-underline [logical : Read / Write / Construct]

If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key. Default value: FALSE

xalign [numeric : Read / Write]

If the child of the button is a GtkMisc or GtkAlignment, 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 Since 2.4

yalign [numeric : Read / Write]

If the child of the button is a GtkMisc or GtkAlignment, 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 Since 2.4

Style Properties

child-displacement-x [integer : Read]

How far in the x direction to move the child when the button is depressed. Default value: 0

child-displacement-y [integer : Read]

How far in the y direction to move the child when the button is depressed. Default value: 0

default-border [GtkBorder : Read]

Extra space to add for CAN_DEFAULT buttons.

default-outside-border [GtkBorder : Read]

Extra space to add for CAN_DEFAULT buttons that is always drawn outside the border.

displace-focus [logical : Read]

Whether the child_displacement_x/child_displacement_y properties should also affect the focus rectangle.

Default value: FALSE Since 2.6

image-spacing [integer : Read]

Spacing in pixels between the image and label. Allowed values: >= 0 Default value: 2

inner-border [GtkBorder : Read]

Sets the border between the button edges and child.

Since 2.10

Author(s)

Derived by RGtkGen from GTK+ documentation

References

http://developer.gnome.org/doc/API/2.0/gtk/GtkButton.html


[Package RGtk2 version 2.12.5-3 Index]