1Gtk2::Button(3)       User Contributed Perl Documentation      Gtk2::Button(3)
2
3
4

NAME

6       Gtk2::Button
7

HIERARCHY

9         Glib::Object
10         +----Glib::InitiallyUnowned
11              +----Gtk2::Object
12                   +----Gtk2::Widget
13                        +----Gtk2::Container
14                             +----Gtk2::Bin
15                                  +----Gtk2::Button
16

INTERFACES

18         Glib::Object::_Unregistered::AtkImplementorIface
19         Gtk2::Buildable
20         Glib::Object::_Unregistered::GtkActivatable
21

MNEMONICS

23       Mnemonics are "memory aids"; in GTK+, a mnemonic is an underlined
24       character which corresponds to a keyboard accelerator.  For a button,
25       that means pressing Alt and that key activates the button.
26
27       For convenience, Gtk2-Perl uses mnemonics by default on widgets that
28       support them.  If characters in label string are preceded by an
29       underscore, they are underlined.  If you need a literal underscore
30       character in a label, use '__' (two underscores).  If you don't want to
31       use mnemonics at all, use the non-mnemonic version explicitly (e.g.
32       "Gtk2::Button::new_with_label").
33

METHODS

35   widget = Gtk2::Button->new
36   widget = Gtk2::Button->new ($mnemonic)
37           ·   $mnemonic (string) used to label the widget, see "MNEMONICS"
38
39   widget = Gtk2::Button->new_from_stock ($stock_id)
40           ·   $stock_id (string) creates a new button using the icon and text
41               from the
42
43           specified stock item, see Gtk2::Stock
44
45   widget = Gtk2::Button->new_with_label ($label)
46           ·   $label (string) used to label the widget
47
48   widget = Gtk2::Button->new_with_mnemonic ($mnemonic)
49           ·   $mnemonic (string) used to label the widget, see "MNEMONICS"
50
51   (xalign, yalign) = $button->get_alignment
52           Since: gtk+ 2.4
53
54   $button->set_alignment ($xalign, $yalign)
55           ·   $xalign (double)
56
57           ·   $yalign (double)
58
59           Since: gtk+ 2.4
60
61   $button->clicked
62   $button->enter
63   boolean = $button->get_focus_on_click
64           Since: gtk+ 2.4
65
66   $button->set_focus_on_click ($focus_on_click)
67           ·   $focus_on_click (boolean)
68
69           Since: gtk+ 2.4
70
71   widget or undef = $button->get_image
72           Since: gtk+ 2.6
73
74   positiontype = $button->get_image_position
75           Since: gtk+ 2.9
76
77   $button->set_image_position ($position)
78           ·   $position (Gtk2::PositionType)
79
80           Since: gtk+ 2.9
81
82   $button->set_image ($image)
83           ·   $image (Gtk2::Widget or undef)
84
85           Since: gtk+ 2.6
86
87   string = $button->get_label
88   $button->set_label ($label)
89           ·   $label (string)
90
91   $button->leave
92   $button->pressed
93   $button->released
94   reliefstyle = $button->get_relief
95   $button->set_relief ($newstyle)
96           ·   $newstyle (Gtk2::ReliefStyle)
97
98   boolean = $button->get_use_stock
99   $button->set_use_stock ($use_stock)
100           ·   $use_stock (boolean)
101
102   boolean = $button->get_use_underline
103   $button->set_use_underline ($use_underline)
104           ·   $use_underline (boolean)
105

PROPERTIES

107       'focus-on-click' (boolean : readable / writable / private)
108           Whether the button grabs focus when it is clicked with the mouse
109
110       'image' (Gtk2::Widget : readable / writable / private)
111           Child widget to appear next to the button text
112
113       'image-position' (Gtk2::PositionType : readable / writable / private)
114           The position of the image relative to the text
115
116       'label' (string : readable / writable / construct / private)
117           Text of the label widget inside the button, if the button contains
118           a label widget
119
120       'relief' (Gtk2::ReliefStyle : readable / writable / private)
121           The border relief style
122
123       'use-stock' (boolean : readable / writable / construct / private)
124           If set, the label is used to pick a stock item instead of being
125           displayed
126
127       'use-underline' (boolean : readable / writable / construct / private)
128           If set, an underline in the text indicates the next character
129           should be used for the mnemonic accelerator key
130
131       'xalign' (Glib::Float : readable / writable / private)
132           Horizontal position of child in available space. 0.0 is left
133           aligned, 1.0 is right aligned
134
135       'yalign' (Glib::Float : readable / writable / private)
136           Vertical position of child in available space. 0.0 is top aligned,
137           1.0 is bottom aligned
138

SIGNALS

140       pressed (Gtk2::Button)
141       released (Gtk2::Button)
142       clicked (Gtk2::Button)
143       enter (Gtk2::Button)
144       leave (Gtk2::Button)
145       activate (Gtk2::Button)
146

ENUMS AND FLAGS

148   enum Gtk2::PositionType
149       ·   'left' / 'GTK_POS_LEFT'
150
151       ·   'right' / 'GTK_POS_RIGHT'
152
153       ·   'top' / 'GTK_POS_TOP'
154
155       ·   'bottom' / 'GTK_POS_BOTTOM'
156
157   enum Gtk2::ReliefStyle
158       ·   'normal' / 'GTK_RELIEF_NORMAL'
159
160       ·   'half' / 'GTK_RELIEF_HALF'
161
162       ·   'none' / 'GTK_RELIEF_NONE'
163

SEE ALSO

165       Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget,
166       Gtk2::Container, Gtk2::Bin
167
169       Copyright (C) 2003-2008 by the gtk2-perl team.
170
171       This software is licensed under the LGPL.  See Gtk2 for a full notice.
172
173
174
175perl v5.12.0                      2010-05-02                   Gtk2::Button(3)
Impressum