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
GtkLabel
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
label_ptr
Default implementationTyped 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)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) 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 transformationtransform_to
ValueTransformer
to use for backwards transformationReturn 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:
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
property
the 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
LabelSignalName
signalDeclaration
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 byuserData
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(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
LabelSignalName
signalDeclaration
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 byuserData
signalHandler
The 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-link
signalDeclaration
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 methodTyped
activate-current-link
signal 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-link
signalDeclaration
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 theactivateLink
signal is emitted -
activateLinkSignal
Extension methodTyped
activate-link
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var activateLinkSignal: LabelSignalName { get }
-
onCopyClipboard(flags:
Extension methodhandler: ) 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 underlyingcopy-clipboard
signalDeclaration
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 methodTyped
copy-clipboard
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var copyClipboardSignal: LabelSignalName { get }
-
onMoveCursor(flags:
Extension methodhandler: ) The
move-cursor
signal 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-cursor
signalDeclaration
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 moveextendSelection
true
if the move should extend the selectionhandler
The signal handler to call Run the given callback whenever the
moveCursor
signal is emitted -
moveCursorSignal
Extension methodTyped
move-cursor
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var moveCursorSignal: LabelSignalName { get }
-
onPopulatePopup(flags:
Extension methodhandler: ) 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 underlyingpopulate-popup
signalDeclaration
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 methodTyped
populate-popup
signal 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 innotify
being 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::angle
signalDeclaration
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 methodTyped
notify::angle
signal 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 innotify
being 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::attributes
signalDeclaration
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 methodTyped
notify::attributes
signal 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 innotify
being 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-position
signalDeclaration
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 methodTyped
notify::cursor-position
signal 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 innotify
being 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::ellipsize
signalDeclaration
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 methodTyped
notify::ellipsize
signal 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 innotify
being 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::justify
signalDeclaration
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 methodTyped
notify::justify
signal 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 innotify
being 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::label
signalDeclaration
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 methodTyped
notify::label
signal 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 innotify
being 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::lines
signalDeclaration
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 methodTyped
notify::lines
signal 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 innotify
being 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-chars
signalDeclaration
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 methodTyped
notify::max-width-chars
signal 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 innotify
being 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-keyval
signalDeclaration
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 methodTyped
notify::mnemonic-keyval
signal 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 innotify
being 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-widget
signalDeclaration
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 methodTyped
notify::mnemonic-widget
signal 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 innotify
being 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::pattern
signalDeclaration
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 methodTyped
notify::pattern
signal 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 innotify
being 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::selectable
signalDeclaration
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 methodTyped
notify::selectable
signal 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 innotify
being 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-bound
signalDeclaration
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 methodTyped
notify::selection-bound
signal 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 innotify
being 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-mode
signalDeclaration
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 methodTyped
notify::single-line-mode
signal 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 innotify
being 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-links
signalDeclaration
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 -
notifyTrackVisitedLinksSignal
Extension methodTyped
notify::track-visited-links
signal 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 innotify
being 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-markup
signalDeclaration
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 methodTyped
notify::use-markup
signal 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 innotify
being 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-underline
signalDeclaration
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 methodTyped
notify::use-underline
signal 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 innotify
being 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-chars
signalDeclaration
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 methodTyped
notify::width-chars
signal 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 innotify
being 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
signalDeclaration
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 methodTyped
notify::wrap
signal 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 innotify
being 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-mode
signalDeclaration
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 methodTyped
notify::wrap-mode
signal 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 innotify
being 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::xalign
signalDeclaration
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 methodTyped
notify::xalign
signal 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 innotify
being 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::yalign
signalDeclaration
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 methodTyped
notify::yalign
signal 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-link
handler or for use in aGtkWidget::query-tooltip
handler.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
PangoLayout
used 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 thelabel
so need not be freed by the caller. Thelabel
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:
Extension methody: ) Obtains the coordinates where the label will draw the
PangoLayout
representing 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 aGtkEventBox
to receive the events, and pack the label inside it, since labels are windowless (they returnfalse
fromgtk_widget_get_has_window()
). Remember when using thePangoLayout
functions 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
true
if 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:xalign
property forlabel
.Declaration
Swift
@inlinable func getXalign() -> Double
-
getYalign()
Extension methodGets the
GtkLabel:yalign
property 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_offset
orend_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
orGtkLabel: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
orGtkLabel: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 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-underline
andGtkLabel: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 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_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 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-markup
property totrue
as a side effect.If you set the label contents using the
GtkLabel:label
property you should also ensure that you set theGtkLabel: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 instr
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
ton_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 aGtkButton
or aGtkNotebook
tab) it is automatically associated with the correct widget, but sometimes (i.e. when the target is aGtkEntry
next to the label) you need to set it explicitly using this function.The target widget will be accelerated by emitting the GtkWidget
mnemonic-activate
signal on it. The default handler for this signal will activate the widget if there are no mnemonic collisions and toggle focus between the colliding widgets otherwise.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 aGtkButton
or aGtkNotebook
tab) it is automatically associated with the correct widget, but sometimes (i.e. when the target is aGtkEntry
next to the label) you need to set it explicitly using this function.The target widget will be accelerated by emitting the GtkWidget
mnemonic-activate
signal on it. The default handler for this signal will activate the widget if there are no mnemonic collisions and toggle focus between the colliding widgets otherwise.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 tofalse
as a side effect.This function will set the
GtkLabel:use-markup
property tofalse
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 instr
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 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
label
ton_chars
.Declaration
Swift
@inlinable func setWidthChars(nChars: Int)
-
set(xalign:
Extension method) Sets the
GtkLabel:xalign
property forlabel
.Declaration
Swift
@inlinable func set(xalign: Double)
-
set(yalign:
Extension method) Sets the
GtkLabel:yalign
property forlabel
.Declaration
Swift
@inlinable func set(yalign: Double)
-
angle
Extension 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 }
-
attributes
Extension methodUndocumented
Declaration
Swift
@inlinable var attributes: Pango.AttrListRef! { get nonmutating set }
-
currentURI
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-link
handler or for use in aGtkWidget::query-tooltip
handler.Declaration
Swift
@inlinable var currentURI: String! { get }
-
ellipsize
Extension 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_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 theGtkNotebook
tab-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 }
-
justify
Extension methodUndocumented
Declaration
Swift
@inlinable var justify: GtkJustification { get nonmutating set }
-
label
Extension methodThe contents of the label.
If the string contains Pango XML markup, you will have to set the
GtkLabel:use-markup
property totrue
in 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-markup
property at the same time.If the string contains underlines acting as mnemonics, you will have to set the
GtkLabel:use-underline
property totrue
in order for the label to display them.Declaration
Swift
@inlinable var label: String! { get nonmutating set }
-
layout
Extension methodGets the
PangoLayout
used 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 thelabel
so need not be freed by the caller. Thelabel
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 methodReturns 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 methodReturns 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 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 }
-
maxWidthChars
Extension methodRetrieves the desired maximum width of
label
, in characters. Seegtk_label_set_width_chars()
.Declaration
Swift
@inlinable var maxWidthChars: Int { get nonmutating set }
-
mnemonicKeyval
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 var mnemonicKeyval: Int { get }
-
mnemonicWidget
Extension 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 }
-
selectable
Extension methodUndocumented
Declaration
Swift
@inlinable var selectable: Bool { get nonmutating set }
-
singleLineMode
Extension methodReturns whether the label is in single line mode.
Declaration
Swift
@inlinable var singleLineMode: Bool { get nonmutating set }
-
text
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 var text: String! { get nonmutating set }
-
trackVisitedLinks
Extension methodReturns whether the label is currently keeping track of clicked links.
Declaration
Swift
@inlinable var trackVisitedLinks: Bool { get nonmutating set }
-
useMarkup
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 var useMarkup: Bool { get nonmutating set }
-
useUnderline
Extension 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 }
-
widthChars
Extension methodRetrieves the desired width of
label
, in characters. Seegtk_label_set_width_chars()
.Declaration
Swift
@inlinable var widthChars: Int { get nonmutating set }
-
xalign
Extension 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 }
-
yalign
Extension 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 }
-
misc
Extension methodUndocumented
Declaration
Swift
@inlinable var misc: GtkMisc { get }