Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: LabelActivatecurrentlinkCallback

[1322:7] extends: object

Generated low-level callback wrapper for GIR callback activate-current-link.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • LabelActivatecurrentlinkCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: Label

[122:7] extends: object

Displays a small amount of text. Most labels are used to label another widget (such as an [class@Entry]). An example GtkLabel ## Shortcuts and Gestures GtkLabel supports the following keyboard shortcuts, when the cursor is visible: - Shift+F10 or Menu opens the context menu. - Ctrl+A or Ctrl+/ selects all.

  • Ctrl+Shift+A or Ctrl+\ unselects all. Additionally, the following signals have default keybindings: - [signal@Gtk.Label::activate-current-link]
  • [signal@Gtk.Label::copy-clipboard] - [signal@Gtk.Label::move-cursor] ## Actions GtkLabel defines a set of built-in actions: - clipboard.copy copies the text to the clipboard. - clipboard.cut doesn't do anything, since text in labels can't be deleted. - clipboard.paste doesn't do anything, since text in labels can't be edited. - link.open opens the link, when activated on a link inside the label. - link.copy copies the link to the clipboard, when activated on a link inside the label. - menu.popup opens the context menu. - selection.delete doesn't do anything, since text in labels can't be deleted. - selection.select-all selects all of the text, if the label allows selection. ## CSS nodes label ├── [selection] ├── [link] ┊ ╰── [link] GtkLabel has a single CSS node with the name label. A wide variety of style classes may be applied to labels, such as .title, .subtitle, .dim-label, etc. In the GtkShortcutsWindow, labels are used with the .keycap style class. If the label has a selection, it gets a subnode with name selection. If the label has links, there is one subnode per link. These subnodes carry the link or visited state depending on whether they have been visited. In this case, label node also gets a .link style class. ## GtkLabel as GtkBuildable The GtkLabel implementation of the GtkBuildable interface supports a custom <attributes> element, which supports any number of <attribute> elements. The <attribute> element has attributes named “name“, “value“, “start“ and “end“ and allows you to specify [struct@Pango.Attribute] values for this label. An example of a UI definition fragment specifying Pango attributes: ```xml
Pango attribute applies. If start and end are not specified, the attribute is
applied to the whole text. Note that specifying ranges does not make much
sense with translatable attributes. Use markup embedded in the translatable
content instead. ## Accessibility `GtkLabel` uses the
[enum@Gtk.AccessibleRole.label] role. ## Mnemonics Labels may contain
“mnemonics”. Mnemonics are underlined characters in the label, used for
keyboard navigation. Mnemonics are created by providing a string with an
underscore before the mnemonic character, such as `"_File"`, to the functions
[ctor@Gtk.Label.new_with_mnemonic] or
[method@Gtk.Label.set_text_with_mnemonic]. Mnemonics automatically activate
any activatable widget the label is inside, such as a [class@Gtk.Button]; if
the label is not inside the mnemonic’s target widget, you have to tell the
label about the target using [method@Gtk.Label.set_mnemonic_widget]. Here’s a
simple example where the label is inside a button: ```c // Pressing Alt+H
will activate this button GtkWidget *button = gtk_button_new (); GtkWidget
*label = gtk_label_new_with_mnemonic ("_Hello"); gtk_button_set_child
(GTK_BUTTON (button), label); ``` There’s a convenience function to create
buttons with a mnemonic label already inside: ```c // Pressing Alt+H will
activate this button GtkWidget *button = gtk_button_new_with_mnemonic
("_Hello"); ``` To create a mnemonic for a widget alongside the label, such
as a [class@Gtk.Entry], you have to point the label at the entry with
[method@Gtk.Label.set_mnemonic_widget]: ```c // Pressing Alt+H will focus the
entry GtkWidget *entry = gtk_entry_new (); GtkWidget *label =
gtk_label_new_with_mnemonic ("_Hello"); gtk_label_set_mnemonic_widget
(GTK_LABEL (label), entry); ``` ## Markup (styled text) To make it easy to
format text in a label (changing colors, fonts, etc.), label text can be
provided in a simple markup format: Here’s how to create a label with a small
font: ```c GtkWidget *label = gtk_label_new (NULL); gtk_label_set_markup
(GTK_LABEL (label), "<small>Small text</small>"); ``` (See the Pango manual
for complete documentation] of available tags, [func@Pango.parse_markup]) The
markup passed to [method@Gtk.Label.set_markup] must be valid XML; for
example, literal `<`, `>` and `&` characters must be escaped as `&lt;`,
`&gt;`, and `&amp;`. If you pass text obtained from the user, file, or a
network to [method@Gtk.Label.set_markup], you’ll want to escape it with
[func@GLib.markup_escape_text] or [func@GLib.markup_printf_escaped]. Markup
strings are just a convenient way to set the [struct@Pango.AttrList] on a
label; [method@Gtk.Label.set_attributes] may be a simpler way to set
attributes in some cases. Be careful though; [struct@Pango.AttrList] tends to
cause internationalization problems, unless you’re applying attributes to the
entire string (i.e. unless you set the range of each attribute to [0,
`G_MAXINT`)). The reason is that specifying the `start_index` and `end_index`
for a [struct@Pango.Attribute] requires knowledge of the exact string being
displayed, so translations will cause problems. ## Selectable labels Labels
can be made selectable with [method@Gtk.Label.set_selectable]. Selectable
labels allow the user to copy the label contents to the clipboard. Only
labels that contain useful-to-copy information — such as error messages —
should be made selectable. ## Text layout A label can contain any number of
paragraphs, but will have performance problems if it contains more than a
small number. Paragraphs are separated by newlines or other paragraph
separators understood by Pango. Labels can automatically wrap text if you
call [method@Gtk.Label.set_wrap]. [method@Gtk.Label.set_justify] sets how the
lines in a label align with one another. If you want to set how the label as
a whole aligns in its available space, see the [property@Gtk.Widget:halign]
and [property@Gtk.Widget:valign] properties. The
[property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars]
properties can be used to control the size allocation of ellipsized or
wrapped labels. For ellipsizing labels, if either is specified (and less than
the actual text size), it is used as the minimum width, and the actual text
size is used as the natural width of the label. For wrapping labels,
width-chars is used as the minimum width, if specified, and max-width-chars
is used as the natural width. Even if max-width-chars specified, wrapping
labels will be rewrapped to use all of the available width. ## Links GTK
supports markup for clickable hyperlinks in addition to regular Pango markup.
The markup for links is borrowed from HTML, using the `<a>` tag with “href“,
“title“ and “class“ attributes. GTK renders links similar to the way they
appear in web browsers, with colored, underlined text. The “title“ attribute
is displayed as a tooltip on the link. The “class“ attribute is used as style
class on the CSS node for the link. An example of inline links looks like
this: ```c const char *text = "Go to the " "<a href=\"https://www.gtk.org\"
title=\"&lt;i&gt;Our&lt;/i&gt; website\">" "GTK website</a> for more...";
GtkWidget *label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL
(label), text); ``` It is possible to implement custom handling for links and
their tooltips with the [signal@Gtk.Label::activate-link] signal and the
[method@Gtk.Label.get_current_uri] function.

#### Members
- **handleObj**
- **lib**
- **retainedCallbacks**
- **signalHandlerNames**
- **signalSetterHandlers**

#### Methods

- **Label** (`str = null`)

	> Creates a new label with the given text inside it. You can pass `NULL` to get an empty label widget.

	- **@p** `str` is the text of the label.


- **toNativeHandle** (`Source`)

	> Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from `fn.call(...)`, another generated wrapper exposing `handle()`, or null. Returns null when the argument carries no pointer.

	- **@p** `Source` is the raw handle, raw buffer, wrapper, or null.
	- **@r** `A` raw pointer carrier or null when no pointer is present.


- **getLib** ()

	> Returns the opened native library for this generated wrapper.

	- **@r** `The` opened native library.


- **handle** ()

	> Returns the wrapped NativeHandle.

	- **@r** `The` wrapped NativeHandle.


- **isNull** ()

	> Returns true when the wrapped handle is null.

	- **@r** `A` bool.


- **describe** ()

	> Returns a small string for debugging generated wrappers.

	- **@r** `A` string.


- **asWidget** ()

	> Wraps this handle as `Widget`.

	- **@r** `A` `Widget` object.


- **asAccessible** ()

	> Wraps this handle as `Accessible`.

	- **@r** `A` `Accessible` object.


- **asAccessibleHypertext** ()

	> Wraps this handle as `AccessibleHypertext`.

	- **@r** `A` `AccessibleHypertext` object.


- **asAccessibleText** ()

	> Wraps this handle as `AccessibleText`.

	- **@r** `A` `AccessibleText` object.


- **asBuildable** ()

	> Wraps this handle as `Buildable`.

	- **@r** `A` `Buildable` object.


- **asConstraintTarget** ()

	> Wraps this handle as `ConstraintTarget`.

	- **@r** `A` `ConstraintTarget` object.


- **connectSignal** (`string Name, CallbackObj`)

	> Connects one generated callback wrapper to a named signal.

	- **@p** `Name` is the signal name.
	- **@p** `CallbackObj` is the generated callback wrapper to connect.
	- **@r** `The` connected handler id.


- **disconnectSignalHandler** (`int HandlerId`)

	> Disconnects one retained signal handler id.

	- **@p** `HandlerId` is the signal handler id to disconnect.
	- **@r** `None.` 


- **setOnActivatecurrentlink** (`callback Fn, UserData = null`)

	> Gets emitted when the user activates a link in the label. The `::activate-current-link` is a [keybinding signal](class.SignalAction.html). Applications may also emit the signal with g_signal_emit_by_name() if they need to control activation of URIs programmatically. The default bindings for this signal are all forms of the <kbd>Enter</kbd> key.

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Label Self).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnActivatelink** (`callback Fn, UserData = null`)

	> Gets emitted to activate a URI. Applications may connect to it to override the default behaviour, which is to call [method@Gtk.FileLauncher.launch].

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Label Self, string Uri).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnCopyclipboard** (`callback Fn, UserData = null`)

	> Gets emitted to copy the selection to the clipboard. The `::copy-clipboard` signal is a [keybinding signal](class.SignalAction.html). The default binding for this signal is <kbd>Ctrl</kbd>+<kbd>c</kbd>.

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Label Self).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **setOnMovecursor** (`callback Fn, UserData = null`)

	> Gets emitted when the user initiates a cursor movement. The `::move-cursor` signal is a [keybinding signal](class.SignalAction.html). If the cursor is not visible in @entry, this signal causes the viewport to be moved instead. Applications should not connect to it, but may emit it with [func@GObject.signal_emit_by_name] if they need to control the cursor programmatically. The default bindings for this signal come in two variants, the variant with the <kbd>Shift</kbd> modifier extends the selection, the variant without the <kbd>Shift</kbd> modifier does not. There are too many key combinations to list them all here. - <kbd>←</kbd>, <kbd>→</kbd>, <kbd>↑</kbd>, <kbd>↓</kbd> move by individual characters/lines - <kbd>Ctrl</kbd>+<kbd>←</kbd>, etc. move by words/paragraphs - <kbd>Home</kbd> and <kbd>End</kbd> move to the ends of the buffer

	- **@p** `Fn` is the Aussom callback.
	- **@p** `Fn` is called with (Label Self, string Step, int Count, bool Extend_selection).
	- **@p** `UserData` is retained and passed through to the generated callback wrapper when provided.
	- **@r** `The` connected handler id.


- **getProperty** (`string Name`)

	> Reads one generated property by name.



- **setProperty** (`string Name, Value`)

	> Writes one generated property by name.



- **setAttributes** (`object Value`)

	> A list of style attributes to apply to the text of the label.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setEllipsize** (`string Value`)

	> The preferred place to ellipsize the string, if the label does not have enough room to display the entire string. Note that setting this property to a value other than [enum.Pango.EllipsizeMode.none] has the side-effect that the label requests only enough space to display the ellipsis "...". In particular, this means that ellipsizing labels do not work well in notebook tabs, unless the [property@Gtk.NotebookPage:tab-expand] child property is set to true. Other ways to set a label's width are [method@Gtk.Widget.set_size_request] and [method@Gtk.Label.set_width_chars].

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setExtramenu** (`object Value`)

	> A menu model whose contents will be appended to the context menu.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setJustify** (`string Value`)

	> 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 [property@Gtk.Label:xalign] for that.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setLabel** (`string Value`)

	> The contents of the label. If the string contains Pango markup (see [func@Pango.parse_markup]), you will have to set the [property@Gtk.Label:use-markup] property to true in order for the label to display the markup attributes. See also [method@Gtk.Label.set_markup] for a convenience function that sets both this property and the [property@Gtk.Label:use-markup] property at the same time. If the string contains underlines acting as mnemonics, you will have to set the [property@Gtk.Label:use-underline] property to true in order for the label to display them.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setLines** (`int Value`)

	> The number of lines to which an ellipsized, wrapping label should display before it gets ellipsized. This both prevents the label from ellipsizing before this many lines are displayed, and limits the height request of the label to this many lines. ::: warning Setting this property has unintuitive and unfortunate consequences for the minimum _width_ of the label. Specifically, if the height of the label is such that it fits a smaller number of lines than the value of this property, the label can not be ellipsized at all, which means it must be wide enough to fit all the text fully. This property has no effect if the label is not wrapping or ellipsized. Set this property to -1 if you don't want to limit the number of lines.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setMaxwidthchars** (`int Value`)

	> The desired maximum width of the label, in characters. If this property is set to -1, the width will be calculated automatically. See the section on [text layout](class.Label.html#text-layout) for details of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] determine the width of ellipsized and wrapped labels.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setMnemonicwidget** (`object Value`)

	> The widget to be activated when the labels mnemonic key is pressed.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setNaturalwrapmode** (`string Value`)

	> Select the line wrapping for the natural size request. This only affects the natural size requested. For the actual wrapping used, see the [property@Gtk.Label:wrap-mode] property. The default is [enum@Gtk.NaturalWrapMode.inherit], which inherits the behavior of the [property@Gtk.Label:wrap-mode] property.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setSelectable** (`bool Value`)

	> Whether the label text can be selected with the mouse.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setSinglelinemode** (`bool Value`)

	> 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.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setTabs** (`object Value`)

	> Custom tabs for this label.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setUsemarkup** (`bool Value`)

	> True if the text of the label includes Pango markup. See [func@Pango.parse_markup].

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setUseunderline** (`bool Value`)

	> True if the text of the label indicates a mnemonic with an `_` before the mnemonic character.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setWidthchars** (`int Value`)

	> The desired width of the label, in characters. If this property is set to -1, the width will be calculated automatically. See the section on [text layout](class.Label.html#text-layout) for details of how [property@Gtk.Label:width-chars] and [property@Gtk.Label:max-width-chars] determine the width of ellipsized and wrapped labels.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setWrap** (`bool Value`)

	> True if the label text will wrap if it gets too wide.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setWrapmode** (`string Value`)

	> Controls how the line wrapping is done. This only affects the formatting if line wrapping is on (see the [property@Gtk.Label:wrap] property). The default is [enum@Pango.WrapMode.word], which means wrap on word boundaries. For sizing behavior, also consider the [property@Gtk.Label:natural-wrap-mode] property.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setXalign** (`double Value`)

	> The horizontal alignment of the label text inside its size allocation. Compare this to [property@Gtk.Widget:halign], which determines how the labels size allocation is positioned in the space available for the label.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setYalign** (`double Value`)

	> The vertical alignment of the label text inside its size allocation. Compare this to [property@Gtk.Widget:valign], which determines how the labels size allocation is positioned in the space available for the label.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **get\_attributes** ()

	> Gets the label's attribute list. This is the [struct@Pango.AttrList] that was set on the label using [method@Gtk.Label.set_attributes], if any. This function does not reflect attributes that come from the label's markup (see [method@Gtk.Label.set_markup]). If you want to get the effective attributes for the label, use `pango_layout_get_attributes (gtk_label_get_layout (self))`.



- **get\_current\_uri** ()

	> Returns the URI for the active link in the label. The active link is the one under the mouse pointer or, in a selectable label, the link in which the text cursor is currently positioned. This function is intended for use in a [signal@Gtk.Label::activate-link] handler or for use in a [signal@Gtk.Widget::query-tooltip] handler.



- **get\_ellipsize** ()

	> Returns the ellipsization mode of the label. See [method@Gtk.Label.set_ellipsize].



- **get\_extra\_menu** ()

	> Gets the extra menu model of the label. See [method@Gtk.Label.set_extra_menu].



- **get\_justify** ()

	> Returns the justification of the label. See [method@Gtk.Label.set_justify].



- **get\_label** ()

	> Fetches the text from a label. The returned text includes any embedded underlines indicating mnemonics and Pango markup. (See [method@Gtk.Label.get_text]).



- **get\_layout** ()

	> Gets the Pango layout used to display the label. The layout is useful to e.g. convert text positions to pixel positions, in combination with [method@Gtk.Label.get_layout_offsets]. The returned layout is owned by the @label so need not be freed by the caller. The @label is free to recreate its layout at any time, so it should be considered read-only.



- **get\_lines** ()

	> Gets the number of lines to which an ellipsized, wrapping label should be limited. See [method@Gtk.Label.set_lines].



- **get\_max\_width\_chars** ()

	> Retrieves the maximum width of the label in characters. See [method@Gtk.Label.set_width_chars].



- **get\_mnemonic\_keyval** ()

	> Return the mnemonic accelerator. If the label has been set so that it has a mnemonic key this function returns the keyval used for the mnemonic accelerator. If there is no mnemonic set up it returns `GDK_KEY_VoidSymbol`.



- **get\_mnemonic\_widget** ()

	> Retrieves the mnemonic target of this label. See [method@Gtk.Label.set_mnemonic_widget].



- **get\_natural\_wrap\_mode** ()

	> Returns natural line wrap mode used by the label. See [method@Gtk.Label.set_natural_wrap_mode].



- **get\_selectable** ()

	> Returns whether the label is selectable.



- **get\_single\_line\_mode** ()

	> Returns whether the label is in single line mode.



- **get\_tabs** ()

	> Gets the tab stops for the label. The returned array will be `NULL` if “standard” (8-space) tabs are used.



- **get\_text** ()

	> Gets the text of the label. The returned text is as it appears on screen. This does not include any embedded underlines indicating mnemonics or Pango markup. (See [method@Gtk.Label.get_label])



- **get\_use\_markup** ()

	> Returns whether the label’s text is interpreted as Pango markup. See [method@Gtk.Label.set_use_markup].



- **get\_use\_underline** ()

	> Returns whether underlines in the label indicate mnemonics. See [method@Gtk.Label.set_use_underline].



- **get\_width\_chars** ()

	> Retrieves the desired width of the label in characters. See [method@Gtk.Label.set_width_chars].



- **get\_wrap** ()

	> Returns whether lines in the label are automatically wrapped. See [method@Gtk.Label.set_wrap].



- **get\_wrap\_mode** ()

	> Returns line wrap mode used by the label. See [method@Gtk.Label.set_wrap_mode].



- **get\_xalign** ()

	> Gets the `xalign` of the label. See the [property@Gtk.Label:xalign] property.



- **get\_yalign** ()

	> Gets the `yalign` of the label. See the [property@Gtk.Label:yalign] property.



- **select\_region** (`int start_offset, int end_offset`)

	> Selects a range of characters in the label, if the label is selectable. See [method@Gtk.Label.set_selectable]. If the label is not selectable, this function has no effect. If @start_offset or @end_offset are -1, then the end of the label will be substituted.

	- **@p** `start_offset` is start offset, in characters.
	- **@p** `end_offset` is end offset, in characters.
	- **@r** `None.` 


- **set\_attributes** (`object attrs`)

	> Apply attributes to the label text. The attributes set with this function will be applied and merged with any other attributes previously effected by way of the [property@Gtk.Label:use-underline] or [property@Gtk.Label:use-markup] properties While it is not recommended to mix markup strings with manually set attributes, if you must; know that the attributes will be applied to the label after the markup string is parsed.

	- **@p** `attrs` is a list of style attributes.
	- **@r** `None.` 


- **set\_ellipsize** (`string mode`)

	> Sets the mode used to ellipsize the text. The text will be ellipsized if there is not enough space to render the entire string.

	- **@p** `mode` is the ellipsization mode.
	- **@r** `None.` 


- **set\_extra\_menu** (`object model`)

	> Sets a menu model to add to the context menu of the label.

	- **@p** `model` is a menu model.
	- **@r** `None.` 


- **set\_justify** (`string jtype`)

	> Sets the alignment of lines in the label relative to each other. This function has no effect on labels containing only a single line. [enum@Gtk.Justification.left] is the default value when the widget is first created with [ctor@Gtk.Label.new]. If you instead want to set the alignment of the label as a whole, use [method@Gtk.Widget.set_halign] instead.

	- **@p** `jtype` is the new justification.
	- **@r** `None.` 


- **set\_label** (`string str`)

	> Sets the text of the label. The label is interpreted as including embedded underlines and/or Pango markup depending on the values of the [property@Gtk.Label:use-underline] and [property@Gtk.Label:use-markup] properties.

	- **@p** `str` is the new text to set for the label.
	- **@r** `None.` 


- **set\_lines** (`int lines`)

	> Sets the number of lines to which an ellipsized, wrapping label should be limited. This has no effect if the label is not wrapping or ellipsized. Set this to -1 if you don’t want to limit the number of lines.

	- **@p** `lines` is the desired number of lines, or -1.
	- **@r** `None.` 


- **set\_markup** (`string str`)

	> Sets the labels text and attributes from markup. The string must be marked up with Pango markup (see [func@Pango.parse_markup]). If @str is external data, you may need to escape it with [func@GLib.markup_escape_text] or [func@GLib.markup_printf_escaped]: ```c GtkWidget *self = gtk_label_new (NULL); const char *str = "..."; const char *format = "<span style=\"italic\">\%s</span>"; char *markup; markup = g_markup_printf_escaped (format, str); gtk_label_set_markup (GTK_LABEL (self), markup); g_free (markup); ``` This function sets the [property@Gtk.Label:use-markup] property to true. Also see [method@Gtk.Label.set_text].

	- **@p** `str` is the markup string.
	- **@r** `None.` 


- **set\_markup\_with\_mnemonic** (`string str`)

	> Sets the labels text, attributes and mnemonic from markup. Parses @str which is marked up with Pango markup (see [func@Pango.parse_markup]), setting the label’s text and attribute list based on the parse results. If characters in @str are preceded by an underscore, they are underlined indicating that they represent a keyboard accelerator called a mnemonic. The mnemonic key can be used to activate another widget, chosen automatically, or explicitly using [method@Gtk.Label.set_mnemonic_widget].

	- **@p** `str` is the markup string.
	- **@r** `None.` 


- **set\_max\_width\_chars** (`int n_chars`)

	> Sets the maximum width of the label in characters.

	- **@p** `n_chars` is the new maximum width, in characters..
	- **@r** `None.` 


- **set\_mnemonic\_widget** (`object widget`)

	> Associate the label with its mnemonic target. If the label has been set so that it has a mnemonic key (using i.e. [method@Gtk.Label.set_markup_with_mnemonic], [method@Gtk.Label.set_text_with_mnemonic], [ctor@Gtk.Label.new_with_mnemonic] or the [property@Gtk.Label:use_underline] property) the label can be associated with a widget that is the target of the mnemonic. When the label is inside a widget (like a [class@Gtk.Button] or a [class@Gtk.Notebook] tab) it is automatically associated with the correct widget, but sometimes (i.e. when the target is a [class@Gtk.Entry] next to the label) you need to set it explicitly using this function. The target widget will be accelerated by emitting the [signal@Gtk.Widget::mnemonic-activate] signal on it. The default handler for this signal will activate the widget if there are no mnemonic collisions and toggle focus between the colliding widgets otherwise.

	- **@p** `widget` is the target widget.
	- **@r** `None.` 


- **set\_natural\_wrap\_mode** (`string wrap_mode`)

	> Selects the line wrapping for the natural size request. This only affects the natural size requested, for the actual wrapping used, see the [property@Gtk.Label:wrap-mode] property.

	- **@p** `wrap_mode` is the line wrapping mode.
	- **@r** `None.` 


- **set\_selectable** (`bool setting`)

	> Makes text in the label selectable. Selectable labels allow the user to select text from the label, for copy-and-paste.

	- **@p** `setting` is true to allow selecting text in the label.
	- **@r** `None.` 


- **set\_single\_line\_mode** (`bool single_line_mode`)

	> Sets whether the label is in single line mode.

	- **@p** `single_line_mode` is true to enable single line mode.
	- **@r** `None.` 


- **set\_tabs** (`object tabs`)

	> Sets tab stops for the label.

	- **@p** `tabs` is tab stops.
	- **@r** `None.` 


- **set\_text** (`string str`)

	> Sets the text for the label. It overwrites any text that was there before and clears any previously set mnemonic accelerators, and sets the [property@Gtk.Label:use-underline] and [property@Gtk.Label:use-markup] properties to false. Also see [method@Gtk.Label.set_markup].

	- **@p** `str` is the text to show in @self.
	- **@r** `None.` 


- **set\_text\_with\_mnemonic** (`string str`)

	> Sets the text for the label, with mnemonics. If characters in @str are preceded by an underscore, they are underlined indicating that they represent a keyboard accelerator called a mnemonic. The mnemonic key can be used to activate another widget, chosen automatically, or explicitly using [method@Gtk.Label.set_mnemonic_widget].

	- **@p** `str` is the text.
	- **@r** `None.` 


- **set\_use\_markup** (`bool setting`)

	> Sets whether the text of the label contains markup. See [method@Gtk.Label.set_markup].

	- **@p** `setting` is true if the label’s text should be parsed for markup..
	- **@r** `None.` 


- **set\_use\_underline** (`bool setting`)

	> Sets whether underlines in the text indicate mnemonics.

	- **@p** `setting` is true if underlines in the text indicate mnemonics.
	- **@r** `None.` 


- **set\_width\_chars** (`int n_chars`)

	> Sets the desired width in characters of the label.

	- **@p** `n_chars` is the new desired width, in characters..
	- **@r** `None.` 


- **set\_wrap** (`bool wrap`)

	> Toggles line wrapping within the label. True makes it break lines if text exceeds the widget’s size. false lets the text get cut off by the edge of the widget if it exceeds the widget size. Note that setting line wrapping to true does not make the label wrap at its parent widget’s width, because GTK widgets conceptually can’t make their requisition depend on the parent widget’s size. For a label that wraps at a specific position, set the label’s width using [method@Gtk.Widget.set_size_request].

	- **@p** `wrap` is whether to wrap lines.
	- **@r** `None.` 


- **set\_wrap\_mode** (`string wrap_mode`)

	> Controls how line wrapping is done. This only affects the label if line wrapping is on. (See [method@Gtk.Label.set_wrap]) The default is [enum@Pango.WrapMode.word], which means wrap on word boundaries. For sizing behavior, also consider the [property@Gtk.Label:natural-wrap-mode] property.

	- **@p** `wrap_mode` is the line wrapping mode.
	- **@r** `None.` 


- **set\_xalign** (`double xalign`)

	> Sets the `xalign` of the label. See the [property@Gtk.Label:xalign] property.

	- **@p** `xalign` is the new xalign value, between 0 and 1.
	- **@r** `None.` 


- **set\_yalign** (`double yalign`)

	> Sets the `yalign` of the label. See the [property@Gtk.Label:yalign] property.

	- **@p** `yalign` is the new yalign value, between 0 and 1.
	- **@r** `None.` 




## class: LabelCopyclipboardCallback

[1462:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `copy-clipboard`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **LabelCopyclipboardCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: LabelCtors

[1290:14] `static` **extends: object** 

Alternate constructors for `Label`. Usage:
`LabelCtors.<name>(...)`. The primary constructor lives
directly on `Label`.

#### Methods

- **newWithMnemonic** (`string str`)

	> Creates a new label with the given text inside it, and a mnemonic. If characters in @str are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. The mnemonic key can be used to activate another widget, chosen automatically, or explicitly using [method@Gtk.Label.set_mnemonic_widget]. If [method@Gtk.Label.set_mnemonic_widget] is not called, then the first activatable ancestor of the label will be chosen as the mnemonic widget. For instance, if the label is inside a button or menu item, the button or menu item will automatically become the mnemonic widget and be activated by the mnemonic.

	- **@p** `str` is the text of the label, with an underscore in front of the mnemonic character.
	- **@r** `A` new `Label`.




## class: LabelMovecursorCallback

[1532:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `move-cursor`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **LabelMovecursorCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, step, count, extend_selection, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: LabelActivatelinkCallback

[1392:7] **extends: object** 

Generated low-level callback wrapper for GIR callback `activate-link`.

#### Members
- **callbackObj**
- **userFn**
- **userData**
- **hasUserData**

#### Methods

- **LabelActivatelinkCallback** (`callback Fn, UserData = null`)

	> Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking `Fn`.

	- **@p** `Fn` is the Aussom callback implementation.
	- **@p** `UserData` is retained and passed through to Fn on each invocation when provided.


- **trampoline** (`nativeSelf, uri, nativeUserData`)

	> Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.



- **callback** ()

	> Returns the wrapped NativeCallback.



- **handle** ()

	> Returns the callback as a NativeHandle.



- **close** ()

	> Closes the underlying NativeCallback.



- **isClosed** ()

	> Returns true when the callback has been closed.





## class: LabelMeta

[1604:14] `static` **extends: object** 

Generated metadata helpers for `Label` class surfaces.

#### Methods

- **properties** ()

	> Returns property metadata for `Label`.

	- **@r** `A` list.


- **signals** ()

	> Returns signal metadata for `Label`.

	- **@r** `A` list.