TextTagProtocol
public protocol TextTagProtocol : ObjectProtocol
A tag that can be applied to text contained in a GtkTextBuffer.
You may wish to begin by reading the text widget conceptual overview, which gives an overview of all the objects and data types related to the text widget and how they work together.
Tags should be in the [classGtk.TextTagTable] for a given
GtkTextBuffer before using them with that buffer.
[methodGtk.TextBuffer.create_tag] is the best way to create tags.
See “gtk4-demo” for numerous examples.
For each property of GtkTextTag, there is a “set” property, e.g.
“font-set” corresponds to “font”. These “set” properties reflect
whether a property has been set or not.
They are maintained by GTK and you should not set them independently.
The TextTagProtocol protocol exposes the methods and properties of an underlying GtkTextTag 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 TextTag.
Alternatively, use TextTagRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkTextTaginstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
text_tag_ptrDefault implementationTyped pointer to the underlying
GtkTextTaginstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkTextTaginstance.Declaration
Swift
var text_tag_ptr: UnsafeMutablePointer<GtkTextTag>! { get } -
Required Initialiser for types conforming to
TextTagProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
TextTagPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: TextTagPropertyName, 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 TextTag property
Declaration
Swift
@inlinable func get(property: TextTagPropertyName) -> 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 TextTag property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: TextTagPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
changed(sizeChanged:Extension method) Emits the [signal
Gtk.TextTagTable::tag-changed] signal on theGtkTextTagTablewhere the tag is included.The signal is already emitted when setting a
GtkTextTagproperty. This function is useful for aGtkTextTagsubclass.Declaration
Swift
@inlinable func changed(sizeChanged: Bool) -
getPriority()Extension methodGet the tag priority.
Declaration
Swift
@inlinable func getPriority() -> Int -
set(priority:Extension method) Sets the priority of a
GtkTextTag.Valid priorities start at 0 and go to one less than [method
Gtk.TextTagTable.get_size]. Each tag in a table has a unique priority; setting the priority of one tag shifts the priorities of all the other tags in the table to maintain a unique priority for each tag.Higher priority tags “win” if two tags both set the same text attribute. When adding a tag to a tag table, it will be assigned the highest priority in the table by default; so normally the precedence of a set of tags is the order in which they were added to the table, or created with [method
Gtk.TextBuffer.create_tag], which adds the tag to the buffer’s table automatically.Declaration
Swift
@inlinable func set(priority: Int) -
priorityExtension methodGet the tag priority.
Declaration
Swift
@inlinable var priority: Int { get nonmutating set } -
parentInstanceExtension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GObject { get }
View on GitHub
Install in Dash
TextTagProtocol Protocol Reference