LabelProtocol

public protocol LabelProtocol : MiscProtocol

The GtkLabel widget displays a small amount of text. As the name implies, most labels are used to label another widget such as a GtkButton, a GtkMenuItem, or a GtkComboBox.

CSS nodes

(plain Language Example):

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

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 PangoAttribute values for this label.

An example of a UI definition fragment specifying Pango attributes:

<object class="GtkLabel">
  <attributes>
    <attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
    <attribute name="background" value="red" start="5" end="10"/>
  </attributes>
</object>

The start and end attributes specify the range of characters to which the 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.

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 gtk_label_new_with_mnemonic() or gtk_label_set_text_with_mnemonic().

Mnemonics automatically activate any activatable widget the label is inside, such as a GtkButton; if the label is not inside the mnemonic’s target widget, you have to tell the label about the target using gtk_label_set_mnemonic_widget(). Here’s a simple example where the label is inside a button:

(C Language Example):

  // Pressing Alt+H will activate this button
  GtkWidget *button = gtk_button_new ();
  GtkWidget *label = gtk_label_new_with_mnemonic ("_Hello");
  gtk_container_add (GTK_CONTAINER (button), label);

There’s a convenience function to create buttons with a mnemonic label already inside:

(C Language Example):

  // 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 GtkEntry, you have to point the label at the entry with gtk_label_set_mnemonic_widget():

(C Language Example):

  // 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 Language Example):

  GtkWidget *label = gtk_label_new (NULL);
  gtk_label_set_markup (GTK_LABEL (label), "<small>Small text</small>");

(See complete documentation of available tags in the Pango manual.)

The markup passed to gtk_label_set_markup() must be valid; for example, literal <, > and & characters must be escaped as <, >, and &. If you pass text obtained from the user, file, or a network to gtk_label_set_markup(), you’ll want to escape it with g_markup_escape_text() or g_markup_printf_escaped().

Markup strings are just a convenient way to set the PangoAttrList on a label; gtk_label_set_attributes() may be a simpler way to set attributes in some cases. Be careful though; PangoAttrList 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 PangoAttribute requires knowledge of the exact string being displayed, so translations will cause problems.

Selectable labels

Labels can be made selectable with 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 gtk_label_set_line_wrap().

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 GtkWidget:halign and GtkWidget:valign properties.

The GtkLabel:width-chars and GtkLabel: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.

Note that the interpretation of GtkLabel:width-chars and GtkLabel:max-width-chars has changed a bit with the introduction of width-for-height geometry management.

Links

Since 2.18, GTK+ supports markup for clickable hyperlinks in addition to regular Pango markup. The markup for links is borrowed from HTML, using the &lt;a&gt; with “href“ and “title“ 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.

An example looks like this:

(C Language Example):

const gchar *text =
"Go to the"
"<a href=\"http://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 GtkLabel::activate-link signal and the gtk_label_get_current_uri() function.

The LabelProtocol protocol exposes the methods and properties of an underlying GtkLabel instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Label. Alternatively, use LabelRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkLabel instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • label_ptr Default implementation

    Typed pointer to the underlying GtkLabel instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkLabel instance.

    Declaration

    Swift

    var label_ptr: UnsafeMutablePointer<GtkLabel>! { get }
  • Required Initialiser for types conforming to LabelProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

Label Class

  • Bind a LabelPropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: LabelPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a Label property

    Declaration

    Swift

    @inlinable
    func get(property: LabelPropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    Set the value of a Label property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: LabelPropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

Label signals

  • Connect a Swift signal handler to the given, typed LabelSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: LabelSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    handler

    The Swift signal handler (function or callback) to invoke on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • Connect a C signal handler to the given, typed LabelSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: LabelSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    signalHandler

    The C function to be called on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • A keybinding signal which gets emitted when the user activates a link in the label.

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

    Note

    This represents the underlying activate-current-link signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onActivateCurrentLink(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the activateCurrentLink signal is emitted

  • activateCurrentLinkSignal Extension method

    Typed activate-current-link signal for using the connect(signal:) methods

    Declaration

    Swift

    static var activateCurrentLinkSignal: LabelSignalName { get }
  • The signal which gets emitted to activate a URI. Applications may connect to it to override the default behaviour, which is to call gtk_show_uri_on_window().

    Note

    This represents the underlying activate-link signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onActivateLink(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ uri: String) -> Bool) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    uri

    the URI that is activated

    handler

    true if the link has been activated Run the given callback whenever the activateLink signal is emitted

  • activateLinkSignal Extension method

    Typed activate-link signal for using the connect(signal:) methods

    Declaration

    Swift

    static var activateLinkSignal: LabelSignalName { get }
  • The copy-clipboard signal is a keybinding signal which gets emitted to copy the selection to the clipboard.

    The default binding for this signal is Ctrl-c.

    Note

    This represents the underlying copy-clipboard signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onCopyClipboard(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the copyClipboard signal is emitted

  • copyClipboardSignal Extension method

    Typed copy-clipboard signal for using the connect(signal:) methods

    Declaration

    Swift

    static var copyClipboardSignal: LabelSignalName { get }
  • onMoveCursor(flags:handler:) Extension method

    The move-cursor signal is a keybinding signal which gets emitted when the user initiates a cursor movement. 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 g_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 Shift modifier extends the selection, the variant without the Shift modifer does not. There are too many key combinations to list them all here.

    • Arrow keys move by individual characters/lines
    • Ctrl-arrow key combinations move by words/paragraphs
    • Home/End keys move to the ends of the buffer

    Note

    This represents the underlying move-cursor signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onMoveCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ step: MovementStep, _ count: Int, _ extendSelection: Bool) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    step

    the granularity of the move, as a GtkMovementStep

    count

    the number of step units to move

    extendSelection

    true if the move should extend the selection

    handler

    The signal handler to call Run the given callback whenever the moveCursor signal is emitted

  • moveCursorSignal Extension method

    Typed move-cursor signal for using the connect(signal:) methods

    Declaration

    Swift

    static var moveCursorSignal: LabelSignalName { get }
  • The populate-popup signal gets emitted before showing the context menu of the label. Note that only selectable labels have context menus.

    If you need to add items to the context menu, connect to this signal and append your menuitems to the menu.

    Note

    This represents the underlying populate-popup signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onPopulatePopup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ menu: MenuRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    menu

    the menu that is being populated

    handler

    The signal handler to call Run the given callback whenever the populatePopup signal is emitted

  • populatePopupSignal Extension method

    Typed populate-popup signal for using the connect(signal:) methods

    Declaration

    Swift

    static var populatePopupSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::angle signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyAngle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyAngle signal is emitted

  • notifyAngleSignal Extension method

    Typed notify::angle signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyAngleSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::attributes signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyAttributes(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyAttributes signal is emitted

  • notifyAttributesSignal Extension method

    Typed notify::attributes signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyAttributesSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::cursor-position signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyCursorPosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyCursorPosition signal is emitted

  • notifyCursorPositionSignal Extension method

    Typed notify::cursor-position signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyCursorPositionSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::ellipsize signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyEllipsize(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyEllipsize signal is emitted

  • notifyEllipsizeSignal Extension method

    Typed notify::ellipsize signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyEllipsizeSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::justify signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyJustify(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyJustify signal is emitted

  • notifyJustifySignal Extension method

    Typed notify::justify signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyJustifySignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::label signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyLabel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyLabel signal is emitted

  • notifyLabelSignal Extension method

    Typed notify::label signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyLabelSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::lines signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyLines(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyLines signal is emitted

  • notifyLinesSignal Extension method

    Typed notify::lines signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyLinesSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::max-width-chars signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyMaxWidthChars(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyMaxWidthChars signal is emitted

  • notifyMaxWidthCharsSignal Extension method

    Typed notify::max-width-chars signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyMaxWidthCharsSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::mnemonic-keyval signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyMnemonicKeyval(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyMnemonicKeyval signal is emitted

  • notifyMnemonicKeyvalSignal Extension method

    Typed notify::mnemonic-keyval signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyMnemonicKeyvalSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::mnemonic-widget signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyMnemonicWidget(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyMnemonicWidget signal is emitted

  • notifyMnemonicWidgetSignal Extension method

    Typed notify::mnemonic-widget signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyMnemonicWidgetSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::pattern signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyPattern(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyPattern signal is emitted

  • notifyPatternSignal Extension method

    Typed notify::pattern signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyPatternSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::selectable signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifySelectable(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifySelectable signal is emitted

  • notifySelectableSignal Extension method

    Typed notify::selectable signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifySelectableSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::selection-bound signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifySelectionBound(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifySelectionBound signal is emitted

  • notifySelectionBoundSignal Extension method

    Typed notify::selection-bound signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifySelectionBoundSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::single-line-mode signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifySingleLineMode(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifySingleLineMode signal is emitted

  • notifySingleLineModeSignal Extension method

    Typed notify::single-line-mode signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifySingleLineModeSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::track-visited-links signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyTrackVisitedLinks(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyTrackVisitedLinks signal is emitted

  • Typed notify::track-visited-links signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyTrackVisitedLinksSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::use-markup signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyUseMarkup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyUseMarkup signal is emitted

  • notifyUseMarkupSignal Extension method

    Typed notify::use-markup signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyUseMarkupSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::use-underline signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyUseUnderline(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyUseUnderline signal is emitted

  • notifyUseUnderlineSignal Extension method

    Typed notify::use-underline signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyUseUnderlineSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::width-chars signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyWidthChars(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyWidthChars signal is emitted

  • notifyWidthCharsSignal Extension method

    Typed notify::width-chars signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyWidthCharsSignal: LabelSignalName { get }
  • onNotifyWrap(flags:handler:) Extension method

    The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::wrap signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyWrap(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyWrap signal is emitted

  • notifyWrapSignal Extension method

    Typed notify::wrap signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyWrapSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::wrap-mode signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyWrapMode(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyWrapMode signal is emitted

  • notifyWrapModeSignal Extension method

    Typed notify::wrap-mode signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyWrapModeSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::xalign signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyXalign(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyXalign signal is emitted

  • notifyXalignSignal Extension method

    Typed notify::xalign signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyXalignSignal: LabelSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:

    (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::yalign signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyYalign(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyYalign signal is emitted

  • notifyYalignSignal Extension method

    Typed notify::yalign signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyYalignSignal: LabelSignalName { get }

Label Class: LabelProtocol extension (methods and fields)

  • getAngle() Extension method

    Gets the angle of rotation for the label. See gtk_label_set_angle().

    Declaration

    Swift

    @inlinable
    func getAngle() -> Double
  • getAttributes() Extension method

    Gets the attribute list that was set on the label using gtk_label_set_attributes(), if any. This function does not reflect attributes that come from the labels markup (see gtk_label_set_markup()). If you want to get the effective attributes for the label, use pango_layout_get_attribute (gtk_label_get_layout (label)).

    Declaration

    Swift

    @inlinable
    func getAttributes() -> Pango.AttrListRef!
  • getCurrentURI() Extension method

    Returns the URI for the currently 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 GtkLabel::activate-link handler or for use in a GtkWidget::query-tooltip handler.

    Declaration

    Swift

    @inlinable
    func getCurrentURI() -> String!
  • getEllipsize() Extension method

    Returns the ellipsizing position of the label. See gtk_label_set_ellipsize().

    Declaration

    Swift

    @inlinable
    func getEllipsize() -> PangoEllipsizeMode
  • getJustify() Extension method

    Returns the justification of the label. See gtk_label_set_justify().

    Declaration

    Swift

    @inlinable
    func getJustify() -> GtkJustification
  • getLabel() Extension method

    Fetches the text from a label widget including any embedded underlines indicating mnemonics and Pango markup. (See gtk_label_get_text()).

    Declaration

    Swift

    @inlinable
    func getLabel() -> String!
  • getLayout() Extension method

    Gets the PangoLayout used to display the label. The layout is useful to e.g. convert text positions to pixel positions, in combination with 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.

    Declaration

    Swift

    @inlinable
    func getLayout() -> Pango.LayoutRef!
  • getLayoutOffsets(x:y:) Extension method

    Obtains the coordinates where the label will draw the PangoLayout representing the text in the label; useful to convert mouse events into coordinates inside the PangoLayout, e.g. to take some action if some part of the label is clicked. Of course you will need to create a GtkEventBox to receive the events, and pack the label inside it, since labels are windowless (they return false from gtk_widget_get_has_window()). Remember when using the PangoLayout functions you need to convert to and from pixels using PANGO_PIXELS() or PANGO_SCALE.

    Declaration

    Swift

    @inlinable
    func getLayoutOffsets(x: UnsafeMutablePointer<gint>! = nil, y: UnsafeMutablePointer<gint>! = nil)
  • getLineWrap() Extension method

    Returns whether lines in the label are automatically wrapped. See gtk_label_set_line_wrap().

    Declaration

    Swift

    @inlinable
    func getLineWrap() -> Bool
  • getLineWrapMode() Extension method

    Returns line wrap mode used by the label. See gtk_label_set_line_wrap_mode().

    Declaration

    Swift

    @inlinable
    func getLineWrapMode() -> PangoWrapMode
  • getLines() Extension method

    Gets the number of lines to which an ellipsized, wrapping label should be limited. See gtk_label_set_lines().

    Declaration

    Swift

    @inlinable
    func getLines() -> Int
  • getMaxWidthChars() Extension method

    Retrieves the desired maximum width of label, in characters. See gtk_label_set_width_chars().

    Declaration

    Swift

    @inlinable
    func getMaxWidthChars() -> Int
  • getMnemonicKeyval() Extension method

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

    Declaration

    Swift

    @inlinable
    func getMnemonicKeyval() -> Int
  • getMnemonicWidget() Extension method

    Retrieves the target of the mnemonic (keyboard shortcut) of this label. See gtk_label_set_mnemonic_widget().

    Declaration

    Swift

    @inlinable
    func getMnemonicWidget() -> WidgetRef!
  • getSelectable() Extension method

    Gets the value set by gtk_label_set_selectable().

    Declaration

    Swift

    @inlinable
    func getSelectable() -> Bool
  • Gets the selected range of characters in the label, returning true if there’s a selection.

    Declaration

    Swift

    @inlinable
    func getSelectionBounds(start: UnsafeMutablePointer<gint>!, end: UnsafeMutablePointer<gint>!) -> Bool
  • getSingleLineMode() Extension method

    Returns whether the label is in single line mode.

    Declaration

    Swift

    @inlinable
    func getSingleLineMode() -> Bool
  • getText() Extension method

    Fetches the text from a label widget, as displayed on the screen. This does not include any embedded underlines indicating mnemonics or Pango markup. (See gtk_label_get_label())

    Declaration

    Swift

    @inlinable
    func getText() -> String!
  • getTrackVisitedLinks() Extension method

    Returns whether the label is currently keeping track of clicked links.

    Declaration

    Swift

    @inlinable
    func getTrackVisitedLinks() -> Bool
  • getUseMarkup() Extension method

    Returns whether the label’s text is interpreted as marked up with the Pango text markup language. See gtk_label_set_use_markup ().

    Declaration

    Swift

    @inlinable
    func getUseMarkup() -> Bool
  • getUseUnderline() Extension method

    Returns whether an embedded underline in the label indicates a mnemonic. See gtk_label_set_use_underline().

    Declaration

    Swift

    @inlinable
    func getUseUnderline() -> Bool
  • getWidthChars() Extension method

    Retrieves the desired width of label, in characters. See gtk_label_set_width_chars().

    Declaration

    Swift

    @inlinable
    func getWidthChars() -> Int
  • getXalign() Extension method

    Gets the GtkLabel:xalign property for label.

    Declaration

    Swift

    @inlinable
    func getXalign() -> Double
  • getYalign() Extension method

    Gets the GtkLabel:yalign property for label.

    Declaration

    Swift

    @inlinable
    func getYalign() -> Double
  • Selects a range of characters in the label, if the label is selectable. See 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.

    Declaration

    Swift

    @inlinable
    func selectRegion(startOffset: Int, endOffset: Int)
  • set(angle:) Extension method

    Sets the angle of rotation for the label. An angle of 90 reads from from bottom to top, an angle of 270, from top to bottom. The angle setting for the label is ignored if the label is selectable, wrapped, or ellipsized.

    Declaration

    Swift

    @inlinable
    func set(angle: Double)
  • setAttributes(attrs:) Extension method

    Sets a PangoAttrList; the attributes in the list are applied 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 GtkLabel:use-underline or GtkLabel: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.

    Declaration

    Swift

    @inlinable
    func setAttributes(attrs: Pango.AttrListRef? = nil)
  • setAttributes(attrs:) Extension method

    Sets a PangoAttrList; the attributes in the list are applied 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 GtkLabel:use-underline or GtkLabel: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.

    Declaration

    Swift

    @inlinable
    func setAttributes<AttrListT>(attrs: AttrListT?) where AttrListT : AttrListProtocol
  • setEllipsize(mode:) Extension method

    Sets the mode used to ellipsize (add an ellipsis: “…”) to the text if there is not enough space to render the entire string.

    Declaration

    Swift

    @inlinable
    func setEllipsize(mode: PangoEllipsizeMode)
  • setJustify(jtype:) Extension method

    Sets the alignment of the lines in the text of the label relative to each other. GTK_JUSTIFY_LEFT is the default value when the widget is first created with gtk_label_new(). If you instead want to set the alignment of the label as a whole, use gtk_widget_set_halign() instead. gtk_label_set_justify() has no effect on labels containing only a single line.

    Declaration

    Swift

    @inlinable
    func setJustify(jtype: GtkJustification)
  • set(label:) Extension method

    Sets the text of the label. The label is interpreted as including embedded underlines and/or Pango markup depending on the values of the GtkLabel:use-underline and GtkLabel:use-markup properties.

    Declaration

    Swift

    @inlinable
    func set(label str: UnsafePointer<gchar>!)
  • setLine(wrap:) Extension method

    Toggles line wrapping within the GtkLabel widget. 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 container’s width, because GTK+ widgets conceptually can’t make their requisition depend on the parent container’s size. For a label that wraps at a specific position, set the label’s width using gtk_widget_set_size_request().

    Declaration

    Swift

    @inlinable
    func setLine(wrap: Bool)
  • setLine(wrapMode:) Extension method

    If line wrapping is on (see gtk_label_set_line_wrap()) this controls how the line wrapping is done. The default is PANGO_WRAP_WORD which means wrap on word boundaries.

    Declaration

    Swift

    @inlinable
    func setLine(wrapMode: PangoWrapMode)
  • set(lines:) Extension method

    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.

    Declaration

    Swift

    @inlinable
    func set(lines: Int)
  • set(markup:) Extension method

    Parses str which is marked up with the Pango text markup language, setting the label’s text and attribute list based on the parse results.

    If the str is external data, you may need to escape it with g_markup_escape_text() or g_markup_printf_escaped():

    (C Language Example):

    GtkWidget *label = gtk_label_new (NULL);
    const char *str = "some text";
    const char *format = "<span style=\"italic\">\%s</span>";
    char *markup;
    
    markup = g_markup_printf_escaped (format, str);
    gtk_label_set_markup (GTK_LABEL (label), markup);
    g_free (markup);
    

    This function will set the GtkLabel:use-markup property to true as a side effect.

    If you set the label contents using the GtkLabel:label property you should also ensure that you set the GtkLabel:use-markup property accordingly.

    See also: gtk_label_set_text()

    Declaration

    Swift

    @inlinable
    func set(markup str: UnsafePointer<gchar>!)
  • setMarkupWith(mnemonic:) Extension method

    Parses str which is marked up with the Pango text markup language, 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 gtk_label_set_mnemonic_widget().

    Declaration

    Swift

    @inlinable
    func setMarkupWith(mnemonic str: UnsafePointer<gchar>!)
  • setMaxWidthChars(nChars:) Extension method

    Sets the desired maximum width in characters of label to n_chars.

    Declaration

    Swift

    @inlinable
    func setMaxWidthChars(nChars: Int)
  • setMnemonic(widget:) Extension method

    If the label has been set so that it has an mnemonic key (using i.e. gtk_label_set_markup_with_mnemonic(), gtk_label_set_text_with_mnemonic(), gtk_label_new_with_mnemonic() or the “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 GtkButton or a GtkNotebook tab) it is automatically associated with the correct widget, but sometimes (i.e. when the target is a GtkEntry next to the label) you need to set it explicitly using this function.

    The target widget will be accelerated by emitting the GtkWidgetmnemonic-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.

    Declaration

    Swift

    @inlinable
    func setMnemonic(widget: WidgetRef? = nil)
  • setMnemonic(widget:) Extension method

    If the label has been set so that it has an mnemonic key (using i.e. gtk_label_set_markup_with_mnemonic(), gtk_label_set_text_with_mnemonic(), gtk_label_new_with_mnemonic() or the “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 GtkButton or a GtkNotebook tab) it is automatically associated with the correct widget, but sometimes (i.e. when the target is a GtkEntry next to the label) you need to set it explicitly using this function.

    The target widget will be accelerated by emitting the GtkWidgetmnemonic-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.

    Declaration

    Swift

    @inlinable
    func setMnemonic<WidgetT>(widget: WidgetT?) where WidgetT : WidgetProtocol
  • set(pattern:) Extension method

    The pattern of underlines you want under the existing text within the GtkLabel widget. For example if the current text of the label says “FooBarBaz” passing a pattern of “___ ___” will underline “Foo” and “Baz” but not “Bar”.

    Declaration

    Swift

    @inlinable
    func set(pattern: UnsafePointer<gchar>!)
  • set(selectable:) Extension method

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

    Declaration

    Swift

    @inlinable
    func set(selectable setting: Bool)
  • set(singleLineMode:) Extension method

    Sets whether the label is in single line mode.

    Declaration

    Swift

    @inlinable
    func set(singleLineMode: Bool)
  • set(text:) Extension method

    Sets the text within the GtkLabel widget. It overwrites any text that was there before.

    This function will clear any previously set mnemonic accelerators, and set the GtkLabel:use-underline property to false as a side effect.

    This function will set the GtkLabel:use-markup property to false as a side effect.

    See also: gtk_label_set_markup()

    Declaration

    Swift

    @inlinable
    func set(text str: UnsafePointer<gchar>!)
  • setTextWith(mnemonic:) Extension method

    Sets the label’s text from the string str. 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 gtk_label_set_mnemonic_widget().

    Declaration

    Swift

    @inlinable
    func setTextWith(mnemonic str: UnsafePointer<gchar>!)
  • Sets whether the label should keep track of clicked links (and use a different color for them).

    Declaration

    Swift

    @inlinable
    func setTrackVisitedLinks(trackLinks: Bool)
  • set(useMarkup:) Extension method

    Sets whether the text of the label contains markup in Pango’s text markup language. See gtk_label_set_markup().

    Declaration

    Swift

    @inlinable
    func set(useMarkup setting: Bool)
  • set(useUnderline:) Extension method

    If true, an underline in the text indicates the next character should be used for the mnemonic accelerator key.

    Declaration

    Swift

    @inlinable
    func set(useUnderline setting: Bool)
  • setWidthChars(nChars:) Extension method

    Sets the desired width in characters of label to n_chars.

    Declaration

    Swift

    @inlinable
    func setWidthChars(nChars: Int)
  • set(xalign:) Extension method

    Sets the GtkLabel:xalign property for label.

    Declaration

    Swift

    @inlinable
    func set(xalign: Double)
  • set(yalign:) Extension method

    Sets the GtkLabel:yalign property for label.

    Declaration

    Swift

    @inlinable
    func set(yalign: Double)
  • angle Extension method

    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.

    Declaration

    Swift

    @inlinable
    var angle: Double { get nonmutating set }
  • attributes Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var attributes: Pango.AttrListRef! { get nonmutating set }
  • currentURI Extension method

    Returns the URI for the currently 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 GtkLabel::activate-link handler or for use in a GtkWidget::query-tooltip handler.

    Declaration

    Swift

    @inlinable
    var currentURI: String! { get }
  • ellipsize Extension method

    The preferred place to ellipsize the string, if the label does not have enough room to display the entire string, specified as a PangoEllipsizeMode.

    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 do not work well in notebook tabs, unless the GtkNotebook tab-expand child property is set to true. Other ways to set a label’s width are gtk_widget_set_size_request() and gtk_label_set_width_chars().

    Declaration

    Swift

    @inlinable
    var ellipsize: PangoEllipsizeMode { get nonmutating set }
  • justify Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var justify: GtkJustification { get nonmutating set }
  • label Extension method

    The contents of the label.

    If the string contains Pango XML markup, you will have to set the GtkLabel:use-markup property to true in order for the label to display the markup attributes. See also gtk_label_set_markup() for a convenience function that sets both this property and the GtkLabel:use-markup property at the same time.

    If the string contains underlines acting as mnemonics, you will have to set the GtkLabel:use-underline property to true in order for the label to display them.

    Declaration

    Swift

    @inlinable
    var label: String! { get nonmutating set }
  • layout Extension method

    Gets the PangoLayout used to display the label. The layout is useful to e.g. convert text positions to pixel positions, in combination with 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.

    Declaration

    Swift

    @inlinable
    var layout: Pango.LayoutRef! { get }
  • lineWrap Extension method

    Returns whether lines in the label are automatically wrapped. See gtk_label_set_line_wrap().

    Declaration

    Swift

    @inlinable
    var lineWrap: Bool { get nonmutating set }
  • lineWrapMode Extension method

    Returns line wrap mode used by the label. See gtk_label_set_line_wrap_mode().

    Declaration

    Swift

    @inlinable
    var lineWrapMode: PangoWrapMode { get nonmutating set }
  • lines Extension method

    The number of lines to which an ellipsized, wrapping label should be limited. 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.

    Declaration

    Swift

    @inlinable
    var lines: Int { get nonmutating set }
  • maxWidthChars Extension method

    Retrieves the desired maximum width of label, in characters. See gtk_label_set_width_chars().

    Declaration

    Swift

    @inlinable
    var maxWidthChars: Int { get nonmutating set }
  • mnemonicKeyval Extension method

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

    Declaration

    Swift

    @inlinable
    var mnemonicKeyval: Int { get }
  • mnemonicWidget Extension method

    Retrieves the target of the mnemonic (keyboard shortcut) of this label. See gtk_label_set_mnemonic_widget().

    Declaration

    Swift

    @inlinable
    var mnemonicWidget: WidgetRef! { get nonmutating set }
  • selectable Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var selectable: Bool { get nonmutating set }
  • singleLineMode Extension method

    Returns whether the label is in single line mode.

    Declaration

    Swift

    @inlinable
    var singleLineMode: Bool { get nonmutating set }
  • text Extension method

    Fetches the text from a label widget, as displayed on the screen. This does not include any embedded underlines indicating mnemonics or Pango markup. (See gtk_label_get_label())

    Declaration

    Swift

    @inlinable
    var text: String! { get nonmutating set }
  • trackVisitedLinks Extension method

    Returns whether the label is currently keeping track of clicked links.

    Declaration

    Swift

    @inlinable
    var trackVisitedLinks: Bool { get nonmutating set }
  • useMarkup Extension method

    Returns whether the label’s text is interpreted as marked up with the Pango text markup language. See gtk_label_set_use_markup ().

    Declaration

    Swift

    @inlinable
    var useMarkup: Bool { get nonmutating set }
  • useUnderline Extension method

    Returns whether an embedded underline in the label indicates a mnemonic. See gtk_label_set_use_underline().

    Declaration

    Swift

    @inlinable
    var useUnderline: Bool { get nonmutating set }
  • widthChars Extension method

    Retrieves the desired width of label, in characters. See gtk_label_set_width_chars().

    Declaration

    Swift

    @inlinable
    var widthChars: Int { get nonmutating set }
  • xalign Extension method

    The xalign property determines the horizontal aligment of the label text inside the labels size allocation. Compare this to GtkWidget:halign, which determines how the labels size allocation is positioned in the space available for the label.

    Declaration

    Swift

    @inlinable
    var xalign: Double { get nonmutating set }
  • yalign Extension method

    The yalign property determines the vertical aligment of the label text inside the labels size allocation. Compare this to GtkWidget:valign, which determines how the labels size allocation is positioned in the space available for the label.

    Declaration

    Swift

    @inlinable
    var yalign: Double { get nonmutating set }
  • misc Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var misc: GtkMisc { get }