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

NAME

6       Gtk2::Label - wrapper for GtkLabel
7

HIERARCHY

9         Glib::Object
10         +----Glib::InitiallyUnowned
11              +----Gtk2::Object
12                   +----Gtk2::Widget
13                        +----Gtk2::Misc
14                             +----Gtk2::Label
15

INTERFACES

17         Glib::Object::_Unregistered::AtkImplementorIface
18         Gtk2::Buildable
19

METHODS

21   widget = Gtk2::Label->new ($str=undef)
22       ·   $str (string or undef)
23
24   widget = Gtk2::Label->new_with_mnemonic ($str)
25       ·   $str (string)
26
27   double = $label->get_angle
28       Since: gtk+ 2.6
29
30   $label->set_angle ($angle)
31       ·   $angle (double)
32
33       Since: gtk+ 2.6
34
35   attrlist = $label->get_attributes
36   $label->set_attributes ($attrs)
37       ·   $attrs (Pango::AttrList)
38
39   string = $label->get_current_uri
40       Since: gtk+ 2.18
41
42   ellipsizemode = $label->get_ellipsize
43       Since: gtk+ 2.6
44
45   $label->set_ellipsize ($mode)
46       ·   $mode (Pango::EllipsizeMode)
47
48       Since: gtk+ 2.6
49
50   justification = $label->get_justify
51   $label->set_justify ($jtype)
52       ·   $jtype (Gtk2::Justification)
53
54   string = $label->get_label
55   $label->set_label ($str)
56       ·   $str (string)
57
58   layout = $label->get_layout
59   (x, y) = $label->get_layout_offsets
60   boolean = $label->get_line_wrap
61   wrapmode = $label->get_line_wrap_mode
62       Since: gtk+ 2.9
63
64   $label->set_line_wrap_mode ($wrap_mode)
65       ·   $wrap_mode (Pango::WrapMode)
66
67       Since: gtk+ 2.9
68
69   $label->set_line_wrap ($wrap)
70       ·   $wrap (boolean)
71
72   $label->set_markup ($str)
73       ·   $str (string)
74
75   $label->set_markup_with_mnemonic ($str)
76       ·   $str (string)
77
78   integer = $label->get_max_width_chars
79       Since: gtk+ 2.6
80
81   $label->set_max_width_chars ($n_chars)
82       ·   $n_chars (integer)
83
84       Since: gtk+ 2.6
85
86   integer = $label->get_mnemonic_keyval
87   widget or undef = $label->get_mnemonic_widget
88   $label->set_mnemonic_widget ($widget)
89       ·   $widget (Gtk2::Widget or undef)
90
91   $label->set_pattern ($pattern)
92       ·   $pattern (string)
93
94   $label->select_region ($start_offset=-1, $end_offset=-1)
95       ·   $start_offset (integer)
96
97       ·   $end_offset (integer)
98
99   boolean = $label->get_selectable
100   $label->set_selectable ($setting)
101       ·   $setting (boolean)
102
103   (start, end) = $label->get_selection_bounds
104       Returns integers, start and end.
105
106   boolean = $label->get_single_line_mode
107       Since: gtk+ 2.6
108
109   $label->set_single_line_mode ($single_line_mode)
110       ·   $single_line_mode (boolean)
111
112       Since: gtk+ 2.6
113
114   string or undef = $label->get_text
115   $label->set_text ($str)
116       ·   $str (string or undef)
117
118   $label->set_text_with_mnemonic ($str)
119       ·   $str (string)
120
121   boolean = $label->get_track_visited_links
122       Since: gtk+ 2.18
123
124   $label->set_track_visited_links ($track_links)
125       ·   $track_links (boolean)
126
127       Since: gtk+ 2.18
128
129   boolean = $label->get_use_markup
130   $label->set_use_markup ($setting)
131       ·   $setting (boolean)
132
133   boolean = $label->get_use_underline
134   $label->set_use_underline ($setting)
135       ·   $setting (boolean)
136
137   integer = $label->get_width_chars
138       Since: gtk+ 2.6
139
140   $label->set_width_chars ($n_chars)
141       ·   $n_chars (integer)
142
143       Since: gtk+ 2.6
144

PROPERTIES

146       'angle' (double : default 0 : readable / writable / private / static-
147       nick / static-blurb)
148           Angle at which the label is rotated
149
150       'attributes' (Pango::AttrList : default undef : readable / writable /
151       private / static-nick / static-blurb)
152           A list of style attributes to apply to the text of the label
153
154       'cursor-position' (integer : default 0 : readable / private / static-
155       nick / static-blurb)
156           The current position of the insertion cursor in chars
157
158       'ellipsize' (Pango::EllipsizeMode : default "none" : readable /
159       writable / private / static-nick / static-blurb)
160           The preferred place to ellipsize the string, if the label does not
161           have enough room to display the entire string
162
163       'justify' (Gtk2::Justification : default "left" : readable / writable /
164       private / static-nick / static-blurb)
165           The alignment of the lines in the text of the label relative to
166           each other. This does NOT affect the alignment of the label within
167           its allocation. See GtkMisc::xalign for that
168
169       'label' (string : default "" : readable / writable / private / static-
170       nick / static-blurb)
171           The text of the label
172
173       'max-width-chars' (integer : default -1 : readable / writable / private
174       / static-nick / static-blurb)
175           The desired maximum width of the label, in characters
176
177       'mnemonic-keyval' (Glib::UInt : default 0xFFFFFF VoidSymbol : readable
178       / private / static-nick / static-blurb)
179           The mnemonic accelerator key for this label
180
181       'mnemonic-widget' (Gtk2::Widget : default undef : readable / writable /
182       private / static-nick / static-blurb)
183           The widget to be activated when the label's mnemonic key is pressed
184
185       'pattern' (string : default undef : writable / private / static-nick /
186       static-blurb)
187           A string with _ characters in positions correspond to characters in
188           the text to underline
189
190       'selectable' (boolean : default false : readable / writable / private /
191       static-nick / static-blurb)
192           Whether the label text can be selected with the mouse
193
194       'selection-bound' (integer : default 0 : readable / private / static-
195       nick / static-blurb)
196           The position of the opposite end of the selection from the cursor
197           in chars
198
199       'single-line-mode' (boolean : default false : readable / writable /
200       private / static-nick / static-blurb)
201           Whether the label is in single line mode
202
203       'track-visited-links' (boolean : default true : readable / writable /
204       private / static-nick / static-blurb)
205           Whether visited links should be tracked
206
207       'use-markup' (boolean : default false : readable / writable / private /
208       static-nick / static-blurb)
209           The text of the label includes XML markup. See pango_parse_markup()
210
211       'use-underline' (boolean : default false : readable / writable /
212       private / static-nick / static-blurb)
213           If set, an underline in the text indicates the next character
214           should be used for the mnemonic accelerator key
215
216       'width-chars' (integer : default -1 : readable / writable / private /
217       static-nick / static-blurb)
218           The desired width of the label, in characters
219
220       'wrap' (boolean : default false : readable / writable / private /
221       static-nick / static-blurb)
222           If set, wrap lines if the text becomes too wide
223
224       'wrap-mode' (Pango::WrapMode : default "word" : readable / writable /
225       private / static-nick / static-blurb)
226           If wrap is set, controls how linewrapping is done
227

SIGNALS

229       activate-current-link (Gtk2::Label)
230       boolean = activate-link (Gtk2::Label, string)
231       copy-clipboard (Gtk2::Label)
232       move-cursor (Gtk2::Label, Gtk2::MovementStep, integer, boolean)
233       populate-popup (Gtk2::Label, Gtk2::Menu)
234

ENUMS AND FLAGS

236   enum Gtk2::Justification
237       ·   'left' / 'GTK_JUSTIFY_LEFT'
238
239       ·   'right' / 'GTK_JUSTIFY_RIGHT'
240
241       ·   'center' / 'GTK_JUSTIFY_CENTER'
242
243       ·   'fill' / 'GTK_JUSTIFY_FILL'
244
245   enum Gtk2::MovementStep
246       ·   'logical-positions' / 'GTK_MOVEMENT_LOGICAL_POSITIONS'
247
248       ·   'visual-positions' / 'GTK_MOVEMENT_VISUAL_POSITIONS'
249
250       ·   'words' / 'GTK_MOVEMENT_WORDS'
251
252       ·   'display-lines' / 'GTK_MOVEMENT_DISPLAY_LINES'
253
254       ·   'display-line-ends' / 'GTK_MOVEMENT_DISPLAY_LINE_ENDS'
255
256       ·   'paragraphs' / 'GTK_MOVEMENT_PARAGRAPHS'
257
258       ·   'paragraph-ends' / 'GTK_MOVEMENT_PARAGRAPH_ENDS'
259
260       ·   'pages' / 'GTK_MOVEMENT_PAGES'
261
262       ·   'buffer-ends' / 'GTK_MOVEMENT_BUFFER_ENDS'
263
264       ·   'horizontal-pages' / 'GTK_MOVEMENT_HORIZONTAL_PAGES'
265
266   enum Pango::EllipsizeMode
267       ·   'none' / 'PANGO_ELLIPSIZE_NONE'
268
269       ·   'start' / 'PANGO_ELLIPSIZE_START'
270
271       ·   'middle' / 'PANGO_ELLIPSIZE_MIDDLE'
272
273       ·   'end' / 'PANGO_ELLIPSIZE_END'
274
275   enum Pango::WrapMode
276       ·   'word' / 'PANGO_WRAP_WORD'
277
278       ·   'char' / 'PANGO_WRAP_CHAR'
279
280       ·   'word-char' / 'PANGO_WRAP_WORD_CHAR'
281

SEE ALSO

283       Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget,
284       Gtk2::Misc
285
287       Copyright (C) 2003-2011 by the gtk2-perl team.
288
289       This software is licensed under the LGPL.  See Gtk2 for a full notice.
290
291
292
293perl v5.32.0                      2020-07-28                    Gtk2::Label(3)
Impressum