/src/wrappers/gtk/library/gtk_label.e
Specman e | 765 lines | 245 code | 148 blank | 372 comment | 2 complexity | 0bdd44f59e6b94316c15d831f9363037 MD5 | raw file
1indexing 2 description: "GtkLabel -- A widget that displays a small to medium amount of text." 3 copyright: "[ 4 Copyright (C) 2006 eiffel-libraries team, GTK+ team 5 6 This library is free software; you can redistribute it and/or 7 modify it under the terms of the GNU Lesser General Public License 8 as published by the Free Software Foundation; either version 2.1 of 9 the License, or (at your option) any later version. 10 11 This library is distributed in the hope that it will be useful, but 12 WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 Lesser General Public License for more details. 15 16 You should have received a copy of the GNU Lesser General Public 17 License along with this library; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19 02110-1301 USA 20 ]" 21 date: "$Date:$" 22 revision: "$Revision:$" 23 24class GTK_LABEL 25 -- The GTK_LABEL widget displays a small amount of text. As the name 26 -- implies, most labels are used to label another widget such as a 27 -- GTK_BUTTON, a GTK_MENU_ITEM, or a GTK_OPTION_MENU. 28 29 -- Mnemonics: Labels may contain mnemonics. Mnemonics are 30 -- underlined characters in the label, used for keyboard 31 -- navigation. Mnemonics are created by providing a string with an 32 -- underscore before the mnemonic character, such as "_File", to 33 -- the `make_with_mnemonic' or `set_text_with_mnemonic' features. 34 35 -- Mnemonics automatically activate any activatable widget the 36 -- label is inside, such as a GtkButton; if the label is not inside 37 -- the mnemonic's target widget, you have to tell the label about 38 -- the target using `set_mnemonic_widget'. Here's a simple example 39 -- where the label is inside a button: 40 41 -- -- Pressing Alt+H will activate this button 42 -- create button.make 43 -- create label.with_mnemonic ("_Hello") 44 -- button.add (label) 45 46 -- There's a convenience function to create buttons with a mnemonic label already inside: 47 48 -- -- Pressing Alt+H will activate this button 49 -- create button.with_mnemonic ("_Hello") 50 51 -- To create a mnemonic for a widget alongside the label, such as a 52 -- GTK_ENTRY, you have to point the label at the entry with 53 -- `set_mnemonic_widget': 54 55 -- /* Pressing Alt+H will focus the entry */ 56 -- entry = gtk_entry_new (); 57 -- label = gtk_label_new_with_mnemonic ("_Hello"); 58 -- gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry); 59 60 -- Markup (styled text): 61 62 -- To make it easy to format text in a label (changing colors, 63 -- fonts, etc.), label text can be provided in a simple markup 64 -- format. Here's how to create a label with a small font: 65 66 -- label = gtk_label_new (NULL); 67 -- gtk_label_set_markup (GTK_LABEL (label), "<small>Small text</small>"); 68 69 -- (See complete documentation of available tags in the Pango 70 -- manual.) 71 72 -- The markup passed to `set_markup' must be valid; for example, 73 -- literal </>/& characters must be escaped as <, >, and 74 -- &. If you pass text obtained from the user, file, or a 75 -- network to `set_markup', you'll want to escape it with (TODO) 76 -- g_markup_escape_text() or g_markup_printf_escaped(). 77 78 -- Markup strings are just a convenient way to set the 79 -- PangoAttrList on a label; `set_attributes' may be a simpler way 80 -- to set attributes in some cases. Be careful though; 81 -- PangoAttrList tends to cause internationalization problems, 82 -- unless you're applying attributes to the entire string 83 -- (i.e. unless you set the range of each attribute to [0, 84 -- G_MAXINT)). The reason is that specifying the start_index and 85 -- end_index for a PangoAttribute requires knowledge of the exact 86 -- string being displayed, so translations will cause problems. 87 88 -- Selectable labels: Labels can be made selectable with 89 -- gtk_label_set_selectable(). Selectable labels allow the user to 90 -- copy the label contents to the clipboard. Only labels that 91 -- contain useful-to-copy information - such as error messages - 92 -- should be made selectable. 93 94 -- Text layout: a label can contain any number of paragraphs, but 95 -- will have performance problems if it contains more than a small 96 -- number. Paragraphs are separated by newlines or other paragraph 97 -- separators understood by Pango. 98 99 -- Labels can automatically wrap text if you call `set_line_wrap'. 100 101 -- `set_justify' sets how the lines in a label align with one 102 -- another. If you want to set how the label as a whole aligns in 103 -- its available space, see `set_alignment' (from GTK_MISC). 104 105inherit 106 GTK_MISC 107 -- Implemented Interfaces: GtkLabel implements 108 -- AtkImplementorIface. 109 110insert GTK_LABEL_EXTERNALS 111 112creation empty, with_label, with_mnemonic, with_markup_label, from_external_pointer 113 114feature {} -- Creation 115 116 empty is 117 -- Creates a new empty label 118 require gtk_initialized: gtk.is_initialized 119 do 120 from_external_pointer (gtk_label_new(default_pointer)) 121 end 122 123 with_label (a_label: STRING) is 124 -- Creates a new label with the given text inside it. 125 require 126 gtk_initialized: gtk.is_initialized 127 valid_label: a_label/=Void 128 do 129 -- In gtk_label_new You can pass Void to get an empty label 130 -- widget.w 131 from_external_pointer (gtk_label_new(a_label.to_external)) 132 end 133 134 with_mnemonic (a_label: STRING) is 135 -- Creates a new GtkLabel, containing the text in 136 -- `a_label'. If characters in `a_label' are preceded by an 137 -- underscore, they are underlined. If you need a literal 138 -- underscore character in a label, use `__' (two 139 -- underscores). The first underlined character represents a 140 -- keyboard accelerator called a mnemonic. The mnemonic key 141 -- can be used to activate another widget, chosen 142 -- automatically, or explicitly using 143 -- `GTK_LABEL.set_mnemonic_widget'. If 144 -- `GTK_LABEL.set_mnemonic_widget' is not called, then the 145 -- first activatable ancestor of the GtkLabel will be chosen 146 -- as the mnemonic widget. For instance, if the label is 147 -- inside a button or menu item, the button or menu item will 148 -- automatically become the mnemonic widget and be activated 149 -- by the mnemonic. 150 require 151 gtk_initialized: gtk.is_initialized 152 label_not_void: a_label/=Void 153 do 154 from_external_pointer (gtk_label_new_with_mnemonic(a_label.to_external)) 155 end 156 157 with_markup_label (a_label: STRING) is 158 -- Creates a new GtkLabel, containing the text in 159 -- `a_label', formatted using Pango markup language. 160 require 161 gtk_initialized: gtk.is_initialized 162 label_not_void: a_label/=Void 163 do 164 from_external_pointer (gtk_label_new(a_label.to_external)) 165 use_markup 166 ensure is_marked_up 167 end 168 169feature 170 set_text (a_string: STRING) is 171 -- Sets the text within the GtkLabel widget. It overwrites 172 -- any text that was there before. This will also clear any 173 -- previously set mnemonic accelerators. 174 require valid_string: a_string/=Void 175 do 176 gtk_label_set_text (handle,a_string.to_external) 177 end 178 179 -- TODO: wrap gtk_label_set_attributes ()void 180 -- gtk_label_set_attributes (GtkLabel *label, PangoAttrList 181 -- *attrs); Sets a PangoAttrList; the attributes in the list are 182 -- applied to the label text. The attributes set with this function 183 -- will be ignored if the "use_underline" property or the 184 -- "use_markup" property is TRUE. label : a GtkLabelattrs : a 185 -- PangoAttrList 186 187 set_markup (a_string: STRING) is 188 -- Parses `a_string' which is marked up with the Pango text 189 -- markup language, setting the label's text and attribute 190 -- list based on the parse results. TODO: Eiffelize this "If 191 -- the str is external data, you may need to escape it with 192 -- g_markup_escape_text() or g_markup_printf_escaped(): char 193 -- *markup; markup = g_markup_printf_escaped ("<span 194 -- style=\"italic\">%s</span>", str); gtk_label_set_markup 195 -- (GTK_LABEL (label), markup); g_free (markup);" 196 require valid_string: a_string/=Void 197 do 198 gtk_label_set_markup (handle,a_string.to_external) 199 end 200 201 set_markup_with_mnemonic (a_string: STRING) is 202 -- Parses `a_string' which is marked up with the Pango text 203 -- markup language, setting the label's text and attribute 204 -- list based on the parse results. If characters in 205 -- `a_string' are preceded by an underscore, they are 206 -- underlined indicating that they represent a keyboard 207 -- accelerator called a mnemonic. 208 209 -- The mnemonic key can be used to activate another widget, 210 -- chosen automatically, or explicitly using 211 -- `set_mnemonic_widget'. 212 require valid_string: a_string/=Void 213 do 214 gtk_label_set_markup_with_mnemonic (handle, a_string.to_external) 215 end 216 217 set_pattern (a_pattern: STRING) is 218 -- The pattern of underlines you want under the existing text 219 -- within the GtkLabel widget. For example if the current 220 -- text of the label says "FooBarBaz" passing a pattern of 221 -- "___ ___" will underline "Foo" and "Baz" but not "Bar". 222 require valid_pattern: a_pattern/=Void 223 do 224 gtk_label_set_pattern (handle, a_pattern.to_external) 225 end 226 227feature -- Justification 228 set_left_justify is 229 -- Makes the lines in the text of the label left-aligned. If 230 -- you instead want to set the alignment of the label as a 231 -- whole, use `GTK_MISC.set_alignment' instead. Has no effect 232 -- on labels containing only a single line. 233 do 234 gtk_label_set_justify (handle,gtk_justify_left) 235 end 236 237 set_right_justify is 238 -- Makes the lines in the text of the label right-aligned. If 239 -- you instead want to set the alignment of the label as a 240 -- whole, use `GTK_MISC.set_alignment' instead. Has no effect 241 -- on labels containing only a single line. 242 do 243 gtk_label_set_justify (handle,gtk_justify_left) 244 end 245 246 set_center_justify is 247 -- Makes the lines in the text of the label center-aligned. If 248 -- you instead want to set the alignment of the label as a 249 -- whole, use `GTK_MISC.set_alignment' instead. Has no effect 250 -- on labels containing only a single line. 251 do 252 gtk_label_set_justify (handle,gtk_justify_center) 253 end 254 255 set_fill_justify is 256 -- Makes the lines in the text of the label distributed 257 -- across the label. If you instead want to set the alignment 258 -- of the label as a whole, use `GTK_MISC.set_alignment' 259 -- instead. Has no effect on labels containing only a single 260 -- line. 261 do 262 gtk_label_set_justify (handle,gtk_justify_fill) 263 end 264 265 is_justify_left: BOOLEAN is 266 -- Is the text placed at the left edge of the label? 267 do 268 Result:=(gtk_label_get_justify(handle)=gtk_justify_left) 269 end 270 271 is_justify_right: BOOLEAN is 272 -- Is the text placed at the right edge of the label? 273 do 274 Result:=(gtk_label_get_justify(handle)=gtk_justify_right) 275 end 276 277 is_justify_center: BOOLEAN is 278 -- Is the text placed at the center of the label? 279 do 280 Result:=(gtk_label_get_justify(handle)=gtk_justify_center) 281 end 282 283 is_justify_fill: BOOLEAN is 284 -- Is the text distribuited across the label? 285 do 286 Result:=(gtk_label_get_justify(handle)=gtk_justify_fill) 287 end 288 289feature -- width desired or maximum 290 -- TODO: wrap gtk_label_set_ellipsize () void 291 -- gtk_label_set_ellipsize (GtkLabel *label, PangoEllipsizeMode 292 -- mode);Sets the mode used to ellipsize (add an ellipsis: "...") 293 -- to the text if there is not enough space to render the entire 294 -- string.label : a GtkLabelmode : a PangoEllipsizeMode 295 296 set_desired_width (n_chars: INTEGER) is 297 -- Sets the desired width in characters of label to `n_chars' characters. 298 do 299 gtk_label_set_width_chars (handle, n_chars) 300 end 301 302 set_max_width (n_chars: INTEGER) is 303 -- Sets the desired maximum width in characters of label to `n_chars'. 304 do 305 gtk_label_set_max_width_chars (handle, n_chars) 306 end 307 308 width_chars: INTEGER is 309 -- the desired width of label, in characters. See `set_desired_width'. 310 do 311 Result := (gtk_label_get_width_chars(handle)) 312 end 313 314 max_width: INTEGER is 315 -- the desired maximum width of label, in characters. See `width_chars'. 316 do 317 Result:=gtk_label_get_max_width_chars(handle) 318 end 319 320feature -- Line wrap 321 set_line_wrap is 322 -- Toggles line wrapping within the GtkLabel widget. It 323 -- breaks lines if text exceeds the widget's size. 324 do 325 gtk_label_set_line_wrap (handle, 1) 326 end 327 328 unset_line_wrap is 329 -- Toggles line wrapping within the GtkLabel widget. It lets 330 -- the text get cut off by the edge of the widget if it 331 -- exceeds the widget size. 332 do 333 gtk_label_set_line_wrap (handle, 0) 334 end 335 336 -- TODO: wrap gtk_label_get_layout_offsets () void 337 -- gtk_label_get_layout_offsets (GtkLabel *label, gint *x, gint 338 -- *y); Obtains the coordinates where the label will draw the 339 -- PangoLayout representing the text in the label; useful to 340 -- convert mouse events into coordinates inside the PangoLayout, 341 -- e.g. to take some action if some part of the label is 342 -- clicked. Of course you will need to create a GtkEventBox to 343 -- receive the events, and pack the label inside it, since labels 344 -- are a GTK_NO_WINDOW widget. Remember when using the PangoLayout 345 -- functions you need to convert to and from pixels using 346 -- PANGO_PIXELS() or PANGO_SCALE. label : a GtkLabel x : location 347 -- to store X offset of layout, or NULL y : location to store Y 348 -- offset of layout, or NULL 349 350feature -- mnemonic 351 mnemonic_keyval: INTEGER is 352 -- The keyval usable for accelerators, or GDK_VoidSymbol. If 353 -- the label has been set so that it has an mnemonic key this 354 -- function returns the keyval used for the mnemonic 355 -- accelerator. If there is no mnemonic set up it returns 356 -- GDK_VoidSymbol. 357 do 358 Result:=gtk_label_get_mnemonic_keyval (handle) 359 end 360 361feature -- Seletability 362 is_selectable: BOOLEAN is 363 -- Can the user copy text from the label? 364 do 365 Result := gtk_label_get_selectable (handle).to_boolean 366 end 367 368 set_selectable is 369 -- Makes the label selectable to allow the user to select 370 -- text from the it, for copy-and-paste. 371 do 372 gtk_label_set_selectable (handle,1) 373 end 374 375 set_unselectable is 376 -- Makes the label not selectable. 377 do 378 gtk_label_set_selectable (handle,0) 379 end 380 381feature -- Text label 382 text: STRING is 383 -- the text from a label widget, as displayed on the 384 -- screen. This does not include any embedded underlines 385 -- indicating mnemonics or Pango markup. (See 386 -- `GTK_LABEL.get_label') 387 do 388 -- gtk_label_get_text returns the internal string used by the 389 -- label, and must not be modified, hence 390 -- STRING.from_external_copy 391 create Result.from_external_copy(gtk_label_get_text(handle)) 392 end 393 394 label: STRING is 395 -- the text from a label widget including any embedded underlines indicating mnemonics and Pango markup. (`text') 396 do 397 create Result.from_external_copy (gtk_label_get_label(handle)) 398 -- using from_external_copy since the returned but 399 -- gtk_label_get_label is owned by the widget and must not be 400 -- modified or freed. 401 end 402 403 set_label (a_string: STRING) is 404 -- Sets the label's text from `a_string'. The label is 405 -- interpreted as including embedded underlines and/or Pango 406 -- markup depending on the values of is_underline_used and 407 -- is_marked_up. 408 require valid_string: a_string/=Void 409 do 410 gtk_label_set_label (handle,a_string.to_external) 411 end 412 413 set_text_with_mnemonic (a_string: STRING) is 414 -- Sets the label's text from `a_string'. If characters in 415 -- `a_string' are preceded by an underscore, they are 416 -- underlined indicating that they represent a keyboard 417 -- accelerator called a mnemonic. The mnemonic key can be 418 -- used to activate another widget, chosen automatically, or 419 -- explicitly using `set_mnemonic_widget'. 420 require valid_string: a_string/=Void 421 do 422 gtk_label_set_text_with_mnemonic (handle, a_string.to_external) 423 end 424 425feature -- mnemonic widget 426 set_mnemonic_widget (a_widget: GTK_WIDGET) is 427 -- If the label has been set so that it has an mnemonic key 428 -- (using i.e. `set_markup_with_mnemonic'), 429 -- `set_text_with_mnemonic', `with_mnemonic' or the 430 -- "use_underline" property) the label can be associated with 431 -- a widget that is the target of the mnemonic. When the 432 -- label is inside a widget (like a GtkButton or a 433 -- GtkNotebook tab) it is automatically associated with the 434 -- correct widget, but sometimes (i.e. when the target is a 435 -- GtkEntry next to the label) you need to set it explicitly 436 -- using this function. 437 438 -- The target widget will be accelerated by emitting 439 -- "mnemonic_activate" on it. The default handler for this 440 -- signal will activate the widget if there are no mnemonic 441 -- collisions and toggle focus between the colliding widgets 442 -- otherwise. 443 require valid_widget: a_widget/=Void 444 do 445 gtk_label_set_mnemonic_widget (handle, a_widget.handle) 446 end 447 448 -- mnemonic_widget: GTK_WIDGET is 449 -- -- the target of the mnemonic (keyboard shortcut) of this 450 -- -- label. See `GTK_LABEL.set_mnemonic_widget'. Void if none 451 -- -- has been set and the default algorithm will be used. 452 -- local widget_ptr: POINTER 453 -- do 454 -- widget_ptr:=gtk_label_get_mnemonic_widget (handle) 455 -- if widget_ptr.is_not_null 456 -- then 457 -- -- TODO: create the right widget, not just a generic GTK_WIDGET 458 -- create Result.from_external_pointer (widget_ptr) 459 -- else check Result=Void end 460 -- end 461 462feature -- Other 463 select_region (a_start_offset, an_end_offset: INTEGER) is 464 -- Selects a range of characters in the label, if the label is 465 -- selectable. See `set_selectable'. If the label is not 466 -- selectable, this function has no effect. If `a_start_offset' 467 -- or `an_end_offset' are -1, then the end of the label will be 468 -- substituted. offset are given in characters not bytes. 469 do 470 gtk_label_select_region (handle, a_start_offset, an_end_offset) 471 end 472 473 -- TODO: attributes: PANGO_ATTR_LIST PangoAttrList* 474 -- gtk_label_get_attributes (GtkLabel *label); Gets the attribute 475 -- list that was set on the label using gtk_label_set_attributes(), 476 -- if any. This function does not reflect attributes that come from 477 -- the labels markup (see gtk_label_set_markup()). If you want to 478 -- get the effective attributes for the label, use 479 -- pango_layout_get_attribute (gtk_label_get_layout (label)). label 480 -- : a GtkLabel Returns : the attribute list, or NULL if none was 481 -- set. 482 483 484 -- TODO: gtk_label_get_ellipsize () PangoEllipsizeMode 485 -- gtk_label_get_ellipsize (GtkLabel *label); Returns the 486 -- ellipsizing position of the label. See 487 -- gtk_label_set_ellipsize(). label : a GtkLabel Returns : 488 -- PangoEllipsizeMode 489 490 -- TODO: gtk_label_get_layout () PangoLayout* gtk_label_get_layout 491 -- (GtkLabel *label); Gets the PangoLayout used to display the 492 -- label. The layout is useful to e.g. convert text positions to 493 -- pixel positions, in combination with 494 -- gtk_label_get_layout_offsets(). The returned layout is owned by 495 -- the label so need not be freed by the caller. 496 497 498 is_line_wrapped: BOOLEAN is 499 -- Is the lines of the label automatically wrapped? 500 do 501 Result:=(gtk_label_get_line_wrap(handle)).to_boolean 502 end 503 504 selection_bounds: TUPLE[BOOLEAN,INTEGER,INTEGER] is 505 -- the selected range of characters in the label, with the 506 -- format: [`is_non_empty', `a_start', `an_end'] `a_start', 507 -- the start of selection, as a character offset; `an_end' 508 -- the end of selection, as a character offset. 509 local is_non_empty, a_start, an_end: INTEGER 510 do 511 is_non_empty:=(gtk_label_get_selection_bounds (handle, $a_start, $an_end)) 512 end 513 514feature -- Markup 515 use_markup is 516 -- Signal that the text of the label contains markup in 517 -- Pango's text markup language. See `set_markup'. 518 do 519 gtk_label_set_use_markup (handle,1) 520 end 521 522 dont_use_markup is 523 -- Signal that the text of the label does not contain markup in 524 -- Pango's text markup language. 525 do 526 gtk_label_set_use_markup (handle,0) 527 end 528 529 is_marked_up: BOOLEAN is 530 -- Is the label's text interpreted as marked up with the Pango 531 -- text markup language?. See `set_use_markup'. 532 do 533 Result:=(gtk_label_get_use_markup(handle)).to_boolean 534 end 535 536feature -- Underline indicating mnemonic 537 is_underline_used: BOOLEAN is 538 -- Does an embedded underline indicate a mnemonic in the label? See `set_use_underline'. 539 do 540 Result:=(gtk_label_get_use_underline(handle)).to_boolean 541 end 542 543 use_underline is 544 -- Puts an underline in the text indicating the next 545 -- character used for the mnemonic accelerator key. 546 do 547 gtk_label_set_use_underline(handle,1) 548 end 549 550 use_no_underline is 551 -- Remove the undeline that indicates the character used for 552 -- the mnemonic accelerator key. 553 do 554 gtk_label_set_use_underline(handle,1) 555 end 556 557feature -- single line mode 558 is_mode_single_line_mode: BOOLEAN is 559 -- Is the label in single line mode? 560 do 561 Result:=(gtk_label_get_single_line_mode(handle)).to_boolean 562 end 563 564 set_single_line_mode is 565 -- Puts the label in single line mode. 566 do 567 gtk_label_set_single_line_mode (handle,1) 568 end 569 570 set_multi_line_mode is 571 -- Puts the label in multi line mode. 572 do 573 gtk_label_set_single_line_mode (handle,0) 574 end 575 576feature -- Angle 577 angle: REAL is 578 -- The angle of rotation for the label. See `set_angle'. 579 do 580 Result:=gtk_label_get_angle(handle) 581 end 582 583 set_angle (an_angle: REAL) is 584 -- Sets the angle of rotation for the label. An angle of 90 585 -- reads from from bottom to top, an angle of 270, from top 586 -- to bottom. The angle setting for the label is ignored if 587 -- the label is selectable, wrapped, or ellipsized. 588 do 589 gtk_label_set_angle (handle, an_angle) 590 end 591 592feature -- Property Details 593-- The "angle" property 594 595-- "angle" gdouble : Read / Write 596 597-- The angle that the baseline of the label makes with the horizontal, in degrees, measured counterclockwise. An angle of 90 reads from from bottom to top, an angle of 270, from top to bottom. Ignored if the label is selectable, wrapped, or ellipsized. 598 599-- Allowed values: [0,360] 600 601-- Default value: 0 602 603-- Since 2.6 604-- The "attributes" property 605 606-- "attributes" PangoAttrList : Read / Write 607 608-- A list of style attributes to apply to the text of the label. 609-- The "cursor-position" property 610 611-- "cursor-position" gint : Read 612 613-- The current position of the insertion cursor in chars. 614 615-- Allowed values: >= 0 616 617-- Default value: 0 618-- The "ellipsize" property 619 620-- "ellipsize" PangoEllipsizeMode : Read / Write 621 622-- The preferred place to ellipsize the string, if the label does not have enough room to display the entire string, specified as a PangoEllisizeMode. 623 624-- Note that setting this property to a value other than PANGO_ELLIPSIZE_NONE has the side-effect that the label requests only enough space to display the ellipsis "...". In particular, this means that ellipsizing labels don't work well in notebook tabs, unless the tab's ::tab-expand property is set to TRUE. Other means to set a label's width are gtk_widget_set_size_request() and gtk_label_set_width_chars(). 625 626-- Default value: PANGO_ELLIPSIZE_NONE 627 628-- Since 2.6 629-- The "justify" property 630 631-- "justify" GtkJustification : Read / Write 632 633-- The alignment of the lines in the text of the label relative to each other. This does NOT affect the alignment of the label within its allocation. See GtkMisc::xalign for that. 634 635-- Default value: GTK_JUSTIFY_LEFT 636-- The "label" property 637 638-- "label" gchararray : Read / Write 639 640-- The text of the label. 641 642-- Default value: NULL 643-- The "max-width-chars" property 644 645-- "max-width-chars" gint : Read / Write 646 647-- The desired maximum width of the label, in characters. If this property is set to -1, the width will be calculated automatically, otherwise the label will request space for no more than the requested number of characters. If the width-chars property is set to a positive value, then the max-width-chars property is ignored. 648 649-- Allowed values: >= -1 650 651-- Default value: -1 652 653-- Since 2.6 654-- The "mnemonic-keyval" property 655 656-- "mnemonic-keyval" guint : Read 657 658-- The mnemonic accelerator key for this label. 659 660-- Default value: 16777215 661-- The "mnemonic-widget" property 662 663-- "mnemonic-widget" GtkWidget : Read / Write 664 665-- The widget to be activated when the label's mnemonic key is pressed. 666-- The "pattern" property 667 668-- "pattern" gchararray : Write 669 670-- A string with _ characters in positions correspond to characters in the text to underline. 671 672-- Default value: NULL 673-- The "selectable" property 674 675-- "selectable" gboolean : Read / Write 676 677-- Whether the label text can be selected with the mouse. 678 679-- Default value: FALSE 680-- The "selection-bound" property 681 682-- "selection-bound" gint : Read 683 684-- The position of the opposite end of the selection from the cursor in chars. 685 686-- Allowed values: >= 0 687 688-- Default value: 0 689-- The "single-line-mode" property 690 691-- "single-line-mode" gboolean : Read / Write 692 693-- Whether the label is in single line mode. In single line mode, the height of the label does not depend on the actual text, it is always set to ascent + descent of the font. This can be an advantage in situations where resizing the label because of text changes would be distracting, e.g. in a statusbar. 694 695-- Default value: FALSE 696 697-- Since 2.6 698-- The "use-markup" property 699 700-- "use-markup" gboolean : Read / Write 701 702-- The text of the label includes XML markup. See pango_parse_markup(). 703 704-- Default value: FALSE 705-- The "use-underline" property 706 707-- "use-underline" gboolean : Read / Write 708 709-- If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key. 710 711-- Default value: FALSE 712-- The "width-chars" property 713 714-- "width-chars" gint : Read / Write 715 716-- The desired width of the label, in characters. If this property is set to -1, the width will be calculated automatically, otherwise the label will request either 3 characters or the property value, whichever is greater. If the width-chars property is set to a positive value, then the max-width-chars property is ignored. 717 718-- Allowed values: >= -1 719 720-- Default value: -1 721 722-- Since 2.6 723-- The "wrap" property 724 725-- "wrap" gboolean : Read / Write 726 727-- If set, wrap lines if the text becomes too wide. 728 729-- Default value: FALSE 730-- Signal Details 731-- The "copy-clipboard" signal 732 733-- void user_function (GtkLabel *label, 734-- gpointer user_data) : Run last / Action 735 736-- label : the object which received the signal. 737-- user_data : user data set when the signal handler was connected. 738-- The "move-cursor" signal 739 740-- void user_function (GtkLabel *label, 741-- GtkMovementStep arg1, 742-- gint arg2, 743-- gboolean arg3, 744-- gpointer user_data) : Run last / Action 745 746-- label : the object which received the signal. 747-- arg1 : 748-- arg2 : 749-- arg3 : 750-- user_data : user data set when the signal handler was connected. 751-- The "populate-popup" signal 752 753-- void user_function (GtkLabel *label, 754-- GtkMenu *arg1, 755-- gpointer user_data) : Run last 756 757-- label : the object which received the signal. 758-- arg1 : 759-- user_data : user data set when the signal handler was connected. 760feature -- size 761 struct_size: INTEGER is 762 external "C inline use <gtk/gtk.h>" 763 alias "sizeof(GtkLabel)" 764 end 765end