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.

  • ptr

    Untyped pointer to the underlying GtkTextTag instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkTextTag instance.

    Default Implementation

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

    Declaration

    Swift

    var text_tag_ptr: UnsafeMutablePointer<GtkTextTag>! { get }
  • Required Initialiser for types conforming to TextTagProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

TextTag Class

  • Bind a TextTagPropertyName source 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 : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a TextTag property

    Declaration

    Swift

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

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    Set the value of a 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

    property

    the property to get the value for

    Return Value

    the value of the named property

TextTag Class: TextTagProtocol extension (methods and fields)

  • changed(sizeChanged:) Extension method

    Emits the [signalGtk.TextTagTable::tag-changed] signal on the GtkTextTagTable where the tag is included.

    The signal is already emitted when setting a GtkTextTag property. This function is useful for a GtkTextTag subclass.

    Declaration

    Swift

    @inlinable
    func changed(sizeChanged: Bool)
  • getPriority() Extension method

    Get 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 [methodGtk.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 [methodGtk.TextBuffer.create_tag], which adds the tag to the buffer’s table automatically.

    Declaration

    Swift

    @inlinable
    func set(priority: Int)
  • priority Extension method

    Get the tag priority.

    Declaration

    Swift

    @inlinable
    var priority: Int { get nonmutating set }
  • parentInstance Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var parentInstance: GObject { get }