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

SIGNALS

220       activate-current-link (Gtk2::Label)
221       boolean = activate-link (Gtk2::Label, string)
222       copy-clipboard (Gtk2::Label)
223       move-cursor (Gtk2::Label, Gtk2::MovementStep, integer, boolean)
224       populate-popup (Gtk2::Label, Gtk2::Menu)
225

ENUMS AND FLAGS

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

SEE ALSO

274       Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget,
275       Gtk2::Misc
276
278       Copyright (C) 2003-2011 by the gtk2-perl team.
279
280       This software is licensed under the LGPL.  See Gtk2 for a full notice.
281
282
283
284perl v5.30.0                      2019-07-26                    Gtk2::Label(3)
Impressum