1Gtk2::Button(3) User Contributed Perl Documentation Gtk2::Button(3)
2
3
4
6 Gtk2::Button - wrapper for GtkButton
7
9 Glib::Object
10 +----Glib::InitiallyUnowned
11 +----Gtk2::Object
12 +----Gtk2::Widget
13 +----Gtk2::Container
14 +----Gtk2::Bin
15 +----Gtk2::Button
16
18 Glib::Object::_Unregistered::AtkImplementorIface
19 Gtk2::Buildable
20 Gtk2::Activatable
21
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
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 window or undef = $button->get_event_window
64 Since: gtk+ 2.22
65
66 boolean = $button->get_focus_on_click
67 Since: gtk+ 2.4
68
69 $button->set_focus_on_click ($focus_on_click)
70 · $focus_on_click (boolean)
71
72 Since: gtk+ 2.4
73
74 widget or undef = $button->get_image
75 Since: gtk+ 2.6
76
77 positiontype = $button->get_image_position
78 Since: gtk+ 2.10
79
80 $button->set_image_position ($position)
81 · $position (Gtk2::PositionType)
82
83 Since: gtk+ 2.10
84
85 $button->set_image ($image)
86 · $image (Gtk2::Widget or undef)
87
88 Since: gtk+ 2.6
89
90 string = $button->get_label
91 $button->set_label ($label)
92 · $label (string)
93
94 $button->leave
95 $button->pressed
96 $button->released
97 reliefstyle = $button->get_relief
98 $button->set_relief ($newstyle)
99 · $newstyle (Gtk2::ReliefStyle)
100
101 boolean = $button->get_use_stock
102 $button->set_use_stock ($use_stock)
103 · $use_stock (boolean)
104
105 boolean = $button->get_use_underline
106 $button->set_use_underline ($use_underline)
107 · $use_underline (boolean)
108
110 'focus-on-click' (boolean : default true : readable / writable /
111 private)
112 Whether the button grabs focus when it is clicked with the mouse
113
114 'image' (Gtk2::Widget : default undef : readable / writable / private)
115 Child widget to appear next to the button text
116
117 'image-position' (Gtk2::PositionType : default "left" : readable /
118 writable / private)
119 The position of the image relative to the text
120
121 'label' (string : default undef : readable / writable / construct /
122 private)
123 Text of the label widget inside the button, if the button contains
124 a label widget
125
126 'relief' (Gtk2::ReliefStyle : default "normal" : readable / writable /
127 private)
128 The border relief style
129
130 'use-stock' (boolean : default false : readable / writable / construct
131 / private)
132 If set, the label is used to pick a stock item instead of being
133 displayed
134
135 'use-underline' (boolean : default false : readable / writable /
136 construct / private)
137 If set, an underline in the text indicates the next character
138 should be used for the mnemonic accelerator key
139
140 'xalign' (float : default 0.5 : readable / writable / private)
141 Horizontal position of child in available space. 0.0 is left
142 aligned, 1.0 is right aligned
143
144 'yalign' (float : default 0.5 : readable / writable / private)
145 Vertical position of child in available space. 0.0 is top aligned,
146 1.0 is bottom aligned
147
149 'child-displacement-x' (integer : default 0 : readable / private)
150 How far in the x direction to move the child when the button is
151 depressed
152
153 'child-displacement-y' (integer : default 0 : readable / private)
154 How far in the y direction to move the child when the button is
155 depressed
156
157 'default-border' (Gtk2::Border : default undef : readable / private)
158 Extra space to add for GTK_CAN_DEFAULT buttons
159
160 'default-outside-border' (Gtk2::Border : default undef : readable /
161 private)
162 Extra space to add for GTK_CAN_DEFAULT buttons that is always drawn
163 outside the border
164
165 'displace-focus' (boolean : default false : readable / private)
166 Whether the child_displacement_x/_y properties should also affect
167 the focus rectangle
168
169 'image-spacing' (integer : default 2 : readable / private)
170 Spacing in pixels between the image and label
171
172 'inner-border' (Gtk2::Border : default undef : readable / private)
173 Border between button edges and child.
174
176 activate (Gtk2::Button)
177 clicked (Gtk2::Button)
178 enter (Gtk2::Button)
179 leave (Gtk2::Button)
180 pressed (Gtk2::Button)
181 released (Gtk2::Button)
182
184 enum Gtk2::PositionType
185 · 'left' / 'GTK_POS_LEFT'
186
187 · 'right' / 'GTK_POS_RIGHT'
188
189 · 'top' / 'GTK_POS_TOP'
190
191 · 'bottom' / 'GTK_POS_BOTTOM'
192
193 enum Gtk2::ReliefStyle
194 · 'normal' / 'GTK_RELIEF_NORMAL'
195
196 · 'half' / 'GTK_RELIEF_HALF'
197
198 · 'none' / 'GTK_RELIEF_NONE'
199
201 Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget,
202 Gtk2::Container, Gtk2::Bin
203
205 Copyright (C) 2003-2011 by the gtk2-perl team.
206
207 This software is licensed under the LGPL. See Gtk2 for a full notice.
208
209
210
211perl v5.28.0 2018-07-18 Gtk2::Button(3)