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 <a> 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=\"<i>Our</i> 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.
-
Untyped pointer to the underlying
GtkLabelinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
label_ptrDefault implementationTyped pointer to the underlying
GtkLabelinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkLabelinstance.Declaration
Swift
var label_ptr: UnsafeMutablePointer<GtkLabel>! { get } -
Required Initialiser for types conforming to
LabelProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
LabelPropertyNamesource 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 : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a Label property
Declaration
Swift
@inlinable func get(property: LabelPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) 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
propertythe property to get the value for
Return Value
the value of the named property
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
LabelSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: LabelSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe 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(signal:Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
LabelSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: LabelSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onActivateCurrentLink(flags:Extension methodhandler: ) 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 underlyingactivate-current-linksignalDeclaration
Swift
@discardableResult @inlinable func onActivateCurrentLink(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
activateCurrentLinksignal is emitted -
activateCurrentLinkSignalExtension methodTyped
activate-current-linksignal for using theconnect(signal:)methodsDeclaration
Swift
static var activateCurrentLinkSignal: LabelSignalName { get } -
onActivateLink(flags:Extension methodhandler: ) 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 underlyingactivate-linksignalDeclaration
Swift
@discardableResult @inlinable func onActivateLink(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ uri: String) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
urithe URI that is activated
handlertrueif the link has been activated Run the given callback whenever theactivateLinksignal is emitted -
activateLinkSignalExtension methodTyped
activate-linksignal for using theconnect(signal:)methodsDeclaration
Swift
static var activateLinkSignal: LabelSignalName { get } -
onCopyClipboard(flags:Extension methodhandler: ) The
copy-clipboardsignal 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 underlyingcopy-clipboardsignalDeclaration
Swift
@discardableResult @inlinable func onCopyClipboard(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
copyClipboardsignal is emitted -
copyClipboardSignalExtension methodTyped
copy-clipboardsignal for using theconnect(signal:)methodsDeclaration
Swift
static var copyClipboardSignal: LabelSignalName { get } -
onMoveCursor(flags:Extension methodhandler: ) The
move-cursorsignal is a keybinding signal which gets emitted when the user initiates a cursor movement. If the cursor is not visible inentry, 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 underlyingmove-cursorsignalDeclaration
Swift
@discardableResult @inlinable func onMoveCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ step: MovementStep, _ count: Int, _ extendSelection: Bool) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
stepthe granularity of the move, as a
GtkMovementStepcountthe number of
stepunits to moveextendSelectiontrueif the move should extend the selectionhandlerThe signal handler to call Run the given callback whenever the
moveCursorsignal is emitted -
moveCursorSignalExtension methodTyped
move-cursorsignal for using theconnect(signal:)methodsDeclaration
Swift
static var moveCursorSignal: LabelSignalName { get } -
onPopulatePopup(flags:Extension methodhandler: ) The
populate-popupsignal 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 underlyingpopulate-popupsignalDeclaration
Parameters
flagsFlags
unownedSelfReference to instance of self
menuthe menu that is being populated
handlerThe signal handler to call Run the given callback whenever the
populatePopupsignal is emitted -
populatePopupSignalExtension methodTyped
populate-popupsignal for using theconnect(signal:)methodsDeclaration
Swift
static var populatePopupSignal: LabelSignalName { get } -
onNotifyAngle(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::anglesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyAngle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyAnglesignal is emitted -
notifyAngleSignalExtension methodTyped
notify::anglesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyAngleSignal: LabelSignalName { get } -
onNotifyAttributes(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::attributessignalDeclaration
Swift
@discardableResult @inlinable func onNotifyAttributes(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyAttributessignal is emitted -
notifyAttributesSignalExtension methodTyped
notify::attributessignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyAttributesSignal: LabelSignalName { get } -
onNotifyCursorPosition(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::cursor-positionsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyCursorPosition(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyCursorPositionsignal is emitted -
notifyCursorPositionSignalExtension methodTyped
notify::cursor-positionsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyCursorPositionSignal: LabelSignalName { get } -
onNotifyEllipsize(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::ellipsizesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyEllipsize(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyEllipsizesignal is emitted -
notifyEllipsizeSignalExtension methodTyped
notify::ellipsizesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyEllipsizeSignal: LabelSignalName { get } -
onNotifyJustify(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::justifysignalDeclaration
Swift
@discardableResult @inlinable func onNotifyJustify(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyJustifysignal is emitted -
notifyJustifySignalExtension methodTyped
notify::justifysignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyJustifySignal: LabelSignalName { get } -
onNotifyLabel(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::labelsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyLabel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyLabelsignal is emitted -
notifyLabelSignalExtension methodTyped
notify::labelsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyLabelSignal: LabelSignalName { get } -
onNotifyLines(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::linessignalDeclaration
Swift
@discardableResult @inlinable func onNotifyLines(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyLinessignal is emitted -
notifyLinesSignalExtension methodTyped
notify::linessignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyLinesSignal: LabelSignalName { get } -
onNotifyMaxWidthChars(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::max-width-charssignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMaxWidthChars(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyMaxWidthCharssignal is emitted -
notifyMaxWidthCharsSignalExtension methodTyped
notify::max-width-charssignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyMaxWidthCharsSignal: LabelSignalName { get } -
onNotifyMnemonicKeyval(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::mnemonic-keyvalsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMnemonicKeyval(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyMnemonicKeyvalsignal is emitted -
notifyMnemonicKeyvalSignalExtension methodTyped
notify::mnemonic-keyvalsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyMnemonicKeyvalSignal: LabelSignalName { get } -
onNotifyMnemonicWidget(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::mnemonic-widgetsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMnemonicWidget(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyMnemonicWidgetsignal is emitted -
notifyMnemonicWidgetSignalExtension methodTyped
notify::mnemonic-widgetsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyMnemonicWidgetSignal: LabelSignalName { get } -
onNotifyPattern(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::patternsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyPattern(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyPatternsignal is emitted -
notifyPatternSignalExtension methodTyped
notify::patternsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyPatternSignal: LabelSignalName { get } -
onNotifySelectable(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::selectablesignalDeclaration
Swift
@discardableResult @inlinable func onNotifySelectable(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifySelectablesignal is emitted -
notifySelectableSignalExtension methodTyped
notify::selectablesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySelectableSignal: LabelSignalName { get } -
onNotifySelectionBound(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::selection-boundsignalDeclaration
Swift
@discardableResult @inlinable func onNotifySelectionBound(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifySelectionBoundsignal is emitted -
notifySelectionBoundSignalExtension methodTyped
notify::selection-boundsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySelectionBoundSignal: LabelSignalName { get } -
onNotifySingleLineMode(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::single-line-modesignalDeclaration
Swift
@discardableResult @inlinable func onNotifySingleLineMode(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifySingleLineModesignal is emitted -
notifySingleLineModeSignalExtension methodTyped
notify::single-line-modesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySingleLineModeSignal: LabelSignalName { get } -
onNotifyTrackVisitedLinks(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::track-visited-linkssignalDeclaration
Swift
@discardableResult @inlinable func onNotifyTrackVisitedLinks(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyTrackVisitedLinkssignal is emitted -
notifyTrackVisitedLinksSignalExtension methodTyped
notify::track-visited-linkssignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyTrackVisitedLinksSignal: LabelSignalName { get } -
onNotifyUseMarkup(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::use-markupsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyUseMarkup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyUseMarkupsignal is emitted -
notifyUseMarkupSignalExtension methodTyped
notify::use-markupsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyUseMarkupSignal: LabelSignalName { get } -
onNotifyUseUnderline(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::use-underlinesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyUseUnderline(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyUseUnderlinesignal is emitted -
notifyUseUnderlineSignalExtension methodTyped
notify::use-underlinesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyUseUnderlineSignal: LabelSignalName { get } -
onNotifyWidthChars(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::width-charssignalDeclaration
Swift
@discardableResult @inlinable func onNotifyWidthChars(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyWidthCharssignal is emitted -
notifyWidthCharsSignalExtension methodTyped
notify::width-charssignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyWidthCharsSignal: LabelSignalName { get } -
onNotifyWrap(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::wrapsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyWrap(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyWrapsignal is emitted -
notifyWrapSignalExtension methodTyped
notify::wrapsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyWrapSignal: LabelSignalName { get } -
onNotifyWrapMode(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::wrap-modesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyWrapMode(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyWrapModesignal is emitted -
notifyWrapModeSignalExtension methodTyped
notify::wrap-modesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyWrapModeSignal: LabelSignalName { get } -
onNotifyXalign(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::xalignsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyXalign(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyXalignsignal is emitted -
notifyXalignSignalExtension methodTyped
notify::xalignsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyXalignSignal: LabelSignalName { get } -
onNotifyYalign(flags:Extension methodhandler: ) 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 tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_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 underlyingnotify::yalignsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyYalign(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: LabelRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyYalignsignal is emitted -
notifyYalignSignalExtension methodTyped
notify::yalignsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyYalignSignal: LabelSignalName { get }
-
getAngle()Extension methodGets the angle of rotation for the label. See
gtk_label_set_angle().Declaration
Swift
@inlinable func getAngle() -> Double -
getAttributes()Extension methodGets 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 (seegtk_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 methodReturns 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-linkhandler or for use in aGtkWidget::query-tooltiphandler.Declaration
Swift
@inlinable func getCurrentURI() -> String! -
getEllipsize()Extension methodReturns the ellipsizing position of the label. See
gtk_label_set_ellipsize().Declaration
Swift
@inlinable func getEllipsize() -> PangoEllipsizeMode -
getJustify()Extension methodReturns the justification of the label. See
gtk_label_set_justify().Declaration
Swift
@inlinable func getJustify() -> GtkJustification -
getLabel()Extension methodFetches 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 methodGets the
PangoLayoutused to display the label. The layout is useful to e.g. convert text positions to pixel positions, in combination withgtk_label_get_layout_offsets(). The returned layout is owned by thelabelso need not be freed by the caller. Thelabelis free to recreate its layout at any time, so it should be considered read-only.Declaration
Swift
@inlinable func getLayout() -> Pango.LayoutRef! -
getLayoutOffsets(x:Extension methody: ) Obtains the coordinates where the label will draw the
PangoLayoutrepresenting the text in the label; useful to convert mouse events into coordinates inside thePangoLayout, e.g. to take some action if some part of the label is clicked. Of course you will need to create aGtkEventBoxto receive the events, and pack the label inside it, since labels are windowless (they returnfalsefromgtk_widget_get_has_window()). Remember when using thePangoLayoutfunctions you need to convert to and from pixels usingPANGO_PIXELS()orPANGO_SCALE.Declaration
Swift
@inlinable func getLayoutOffsets(x: UnsafeMutablePointer<gint>! = nil, y: UnsafeMutablePointer<gint>! = nil) -
getLineWrap()Extension methodReturns whether lines in the label are automatically wrapped. See
gtk_label_set_line_wrap().Declaration
Swift
@inlinable func getLineWrap() -> Bool -
getLineWrapMode()Extension methodReturns line wrap mode used by the label. See
gtk_label_set_line_wrap_mode().Declaration
Swift
@inlinable func getLineWrapMode() -> PangoWrapMode -
getLines()Extension methodGets 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 methodRetrieves the desired maximum width of
label, in characters. Seegtk_label_set_width_chars().Declaration
Swift
@inlinable func getMaxWidthChars() -> Int -
getMnemonicKeyval()Extension methodIf 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 methodRetrieves the target of the mnemonic (keyboard shortcut) of this label. See
gtk_label_set_mnemonic_widget().Declaration
Swift
@inlinable func getMnemonicWidget() -> WidgetRef! -
getSelectable()Extension methodGets the value set by
gtk_label_set_selectable().Declaration
Swift
@inlinable func getSelectable() -> Bool -
getSelectionBounds(start:Extension methodend: ) Gets the selected range of characters in the label, returning
trueif there’s a selection.Declaration
Swift
@inlinable func getSelectionBounds(start: UnsafeMutablePointer<gint>!, end: UnsafeMutablePointer<gint>!) -> Bool -
getSingleLineMode()Extension methodReturns whether the label is in single line mode.
Declaration
Swift
@inlinable func getSingleLineMode() -> Bool -
getText()Extension methodFetches 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 methodReturns whether the label is currently keeping track of clicked links.
Declaration
Swift
@inlinable func getTrackVisitedLinks() -> Bool -
getUseMarkup()Extension methodReturns 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 methodReturns whether an embedded underline in the label indicates a mnemonic. See
gtk_label_set_use_underline().Declaration
Swift
@inlinable func getUseUnderline() -> Bool -
getWidthChars()Extension methodRetrieves the desired width of
label, in characters. Seegtk_label_set_width_chars().Declaration
Swift
@inlinable func getWidthChars() -> Int -
getXalign()Extension methodGets the
GtkLabel:xalignproperty forlabel.Declaration
Swift
@inlinable func getXalign() -> Double -
getYalign()Extension methodGets the
GtkLabel:yalignproperty forlabel.Declaration
Swift
@inlinable func getYalign() -> Double -
selectRegion(startOffset:Extension methodendOffset: ) 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. Ifstart_offsetorend_offsetare -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-underlineorGtkLabel:use-markupproperties. 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-underlineorGtkLabel:use-markupproperties. 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_LEFTis the default value when the widget is first created withgtk_label_new(). If you instead want to set the alignment of the label as a whole, usegtk_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-underlineandGtkLabel:use-markupproperties.Declaration
Swift
@inlinable func set(label str: UnsafePointer<gchar>!) -
setLine(wrap:Extension method) Toggles line wrapping within the
GtkLabelwidget.truemakes it break lines if text exceeds the widget’s size.falselets the text get cut off by the edge of the widget if it exceeds the widget size.Note that setting line wrapping to
truedoes 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 usinggtk_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 isPANGO_WRAP_WORDwhich 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
strwhich is marked up with the Pango text markup language, setting the label’s text and attribute list based on the parse results.If the
stris external data, you may need to escape it withg_markup_escape_text()org_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-markupproperty totrueas a side effect.If you set the label contents using the
GtkLabel:labelproperty you should also ensure that you set theGtkLabel:use-markupproperty accordingly.See also:
gtk_label_set_text()Declaration
Swift
@inlinable func set(markup str: UnsafePointer<gchar>!) -
setMarkupWith(mnemonic:Extension method) Parses
strwhich is marked up with the Pango text markup language, setting the label’s text and attribute list based on the parse results. If characters instrare 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
labelton_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 aGtkButtonor aGtkNotebooktab) it is automatically associated with the correct widget, but sometimes (i.e. when the target is aGtkEntrynext to the label) you need to set it explicitly using this function.The target widget will be accelerated by emitting the GtkWidget
mnemonic-activatesignal 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 aGtkButtonor aGtkNotebooktab) it is automatically associated with the correct widget, but sometimes (i.e. when the target is aGtkEntrynext to the label) you need to set it explicitly using this function.The target widget will be accelerated by emitting the GtkWidget
mnemonic-activatesignal 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
GtkLabelwidget. 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
GtkLabelwidget. It overwrites any text that was there before.This function will clear any previously set mnemonic accelerators, and set the
GtkLabel:use-underlineproperty tofalseas a side effect.This function will set the
GtkLabel:use-markupproperty tofalseas 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 instrare 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 usinggtk_label_set_mnemonic_widget().Declaration
Swift
@inlinable func setTextWith(mnemonic str: UnsafePointer<gchar>!) -
setTrackVisitedLinks(trackLinks:Extension method) 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
labelton_chars.Declaration
Swift
@inlinable func setWidthChars(nChars: Int) -
set(xalign:Extension method) Sets the
GtkLabel:xalignproperty forlabel.Declaration
Swift
@inlinable func set(xalign: Double) -
set(yalign:Extension method) Sets the
GtkLabel:yalignproperty forlabel.Declaration
Swift
@inlinable func set(yalign: Double) -
angleExtension methodThe 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 } -
attributesExtension methodUndocumented
Declaration
Swift
@inlinable var attributes: Pango.AttrListRef! { get nonmutating set } -
currentURIExtension methodReturns 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-linkhandler or for use in aGtkWidget::query-tooltiphandler.Declaration
Swift
@inlinable var currentURI: String! { get } -
ellipsizeExtension methodThe 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_NONEhas 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 theGtkNotebooktab-expand child property is set totrue. Other ways to set a label’s width aregtk_widget_set_size_request()andgtk_label_set_width_chars().Declaration
Swift
@inlinable var ellipsize: PangoEllipsizeMode { get nonmutating set } -
justifyExtension methodUndocumented
Declaration
Swift
@inlinable var justify: GtkJustification { get nonmutating set } -
labelExtension methodThe contents of the label.
If the string contains Pango XML markup, you will have to set the
GtkLabel:use-markupproperty totruein order for the label to display the markup attributes. See alsogtk_label_set_markup()for a convenience function that sets both this property and theGtkLabel:use-markupproperty at the same time.If the string contains underlines acting as mnemonics, you will have to set the
GtkLabel:use-underlineproperty totruein order for the label to display them.Declaration
Swift
@inlinable var label: String! { get nonmutating set } -
layoutExtension methodGets the
PangoLayoutused to display the label. The layout is useful to e.g. convert text positions to pixel positions, in combination withgtk_label_get_layout_offsets(). The returned layout is owned by thelabelso need not be freed by the caller. Thelabelis free to recreate its layout at any time, so it should be considered read-only.Declaration
Swift
@inlinable var layout: Pango.LayoutRef! { get } -
lineWrapExtension methodReturns whether lines in the label are automatically wrapped. See
gtk_label_set_line_wrap().Declaration
Swift
@inlinable var lineWrap: Bool { get nonmutating set } -
lineWrapModeExtension methodReturns line wrap mode used by the label. See
gtk_label_set_line_wrap_mode().Declaration
Swift
@inlinable var lineWrapMode: PangoWrapMode { get nonmutating set } -
linesExtension methodThe 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 } -
maxWidthCharsExtension methodRetrieves the desired maximum width of
label, in characters. Seegtk_label_set_width_chars().Declaration
Swift
@inlinable var maxWidthChars: Int { get nonmutating set } -
mnemonicKeyvalExtension methodIf 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 } -
mnemonicWidgetExtension methodRetrieves 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 } -
selectableExtension methodUndocumented
Declaration
Swift
@inlinable var selectable: Bool { get nonmutating set } -
singleLineModeExtension methodReturns whether the label is in single line mode.
Declaration
Swift
@inlinable var singleLineMode: Bool { get nonmutating set } -
textExtension methodFetches 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 } -
trackVisitedLinksExtension methodReturns whether the label is currently keeping track of clicked links.
Declaration
Swift
@inlinable var trackVisitedLinks: Bool { get nonmutating set } -
useMarkupExtension methodReturns 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 } -
useUnderlineExtension methodReturns 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 } -
widthCharsExtension methodRetrieves the desired width of
label, in characters. Seegtk_label_set_width_chars().Declaration
Swift
@inlinable var widthChars: Int { get nonmutating set } -
xalignExtension methodThe 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 } -
yalignExtension methodThe 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 } -
miscExtension methodUndocumented
Declaration
Swift
@inlinable var misc: GtkMisc { get }
View on GitHub
Install in Dash
LabelProtocol Protocol Reference