1Gtk2::Button(3) User Contributed Perl Documentation Gtk2::Button(3)
2
3
4
6 Gtk2::Button
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
21 Mnemonics are "memory aids"; in GTK+, a mnemonic is an underlined char‐
22 acter which corresponds to a keyboard accelerator. For a button, that
23 means pressing Alt and that key activates the button.
24
25 For convenience, Gtk2-Perl uses mnemonics by default on widgets that
26 support them. If characters in label string are preceded by an under‐
27 score, they are underlined. If you need a literal underscore character
28 in a label, use '__' (two underscores). If you don't want to use
29 mnemonics at all, use the non-mnemonic version explicitly (e.g.
30 "Gtk2::Button::new_with_label").
31
33 widget = Gtk2::Button->new
34
35 widget = Gtk2::Button->new ($mnemonic)
36
37 * $mnemonic (string) used to label the widget, see "MNEMONICS"
38
39 widget = Gtk2::Button->new_from_stock ($stock_id)
40
41 * $stock_id (string) creates a new button using the icon and text
42 from the
43
44 specified stock item, see Gtk2::Stock
45
46 widget = Gtk2::Button->new_with_label ($label)
47
48 * $label (string) used to label the widget
49
50 widget = Gtk2::Button->new_with_mnemonic ($mnemonic)
51
52 * $mnemonic (string) used to label the widget, see "MNEMONICS"
53
54 (xalign, yalign) = $button->get_alignment
55
56 $button->set_alignment ($xalign, $yalign)
57
58 * $xalign (double)
59 * $yalign (double)
60
61 $button->clicked
62
63 $button->enter
64
65 boolean = $button->get_focus_on_click
66
67 $button->set_focus_on_click ($focus_on_click)
68
69 * $focus_on_click (boolean)
70
71 widget or undef = $button->get_image
72
73 positiontype = $button->get_image_position
74
75 $button->set_image_position ($position)
76
77 * $position (Gtk2::PositionType)
78
79 $button->set_image ($image)
80
81 * $image (Gtk2::Widget or undef)
82
83 string = $button->get_label
84
85 $button->set_label ($label)
86
87 * $label (string)
88
89 $button->leave
90
91 $button->pressed
92
93 $button->released
94
95 reliefstyle = $button->get_relief
96
97 $button->set_relief ($newstyle)
98
99 * $newstyle (Gtk2::ReliefStyle)
100
101 boolean = $button->get_use_stock
102
103 $button->set_use_stock ($use_stock)
104
105 * $use_stock (boolean)
106
107 boolean = $button->get_use_underline
108
109 $button->set_use_underline ($use_underline)
110
111 * $use_underline (boolean)
112
114 'focus-on-click' (boolean : readable / writable / private)
115 Whether the button grabs focus when it is clicked with the mouse
116
117 'image' (Gtk2::Widget : readable / writable / private)
118 Child widget to appear next to the button text
119
120 'image-position' (Gtk2::PositionType : readable / writable / private)
121 The position of the image relative to the text
122
123 'label' (string : readable / writable / construct / private)
124 Text of the label widget inside the button, if the button contains
125 a label widget
126
127 'relief' (Gtk2::ReliefStyle : readable / writable / private)
128 The border relief style
129
130 'use-stock' (boolean : readable / writable / construct / private)
131 If set, the label is used to pick a stock item instead of being
132 displayed
133
134 'use-underline' (boolean : readable / writable / construct / private)
135 If set, an underline in the text indicates the next character
136 should be used for the mnemonic accelerator key
137
138 'xalign' (Glib::Float : readable / writable / private)
139 Horizontal position of child in available space. 0.0 is left
140 aligned, 1.0 is right aligned
141
142 'yalign' (Glib::Float : readable / writable / private)
143 Vertical position of child in available space. 0.0 is top aligned,
144 1.0 is bottom aligned
145
147 pressed (Gtk2::Button)
148 released (Gtk2::Button)
149 clicked (Gtk2::Button)
150 enter (Gtk2::Button)
151 leave (Gtk2::Button)
152 activate (Gtk2::Button)
153
155 enum Gtk2::PositionType
156
157 * 'left' / 'GTK_POS_LEFT'
158 * 'right' / 'GTK_POS_RIGHT'
159 * 'top' / 'GTK_POS_TOP'
160 * 'bottom' / 'GTK_POS_BOTTOM'
161
162 enum Gtk2::ReliefStyle
163
164 * 'normal' / 'GTK_RELIEF_NORMAL'
165 * 'half' / 'GTK_RELIEF_HALF'
166 * 'none' / 'GTK_RELIEF_NONE'
167
169 Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget,
170 Gtk2::Container, Gtk2::Bin
171
173 Copyright (C) 2003-2007 by the gtk2-perl team.
174
175 This software is licensed under the LGPL. See Gtk2 for a full notice.
176
177
178
179perl v5.8.8 2007-03-18 Gtk2::Button(3)