TextProtocol

public protocol TextProtocol : EditableProtocol

The GtkText widget is a single-line text entry widget.

GtkText is the common implementation of single-line text editing that is shared between GtkEntry, GtkPasswordEntry, GtkSpinButton and other widgets. In all of these, GtkText is used as the delegate for the [ifaceGtk.Editable] implementation.

A fairly large set of key bindings are supported by default. If the entered text is longer than the allocation of the widget, the widget will scroll so that the cursor position is visible.

When using an entry for passwords and other sensitive information, it can be put into “password mode” using [methodGtk.Text.set_visibility]. In this mode, entered text is displayed using a “invisible” character. By default, GTK picks the best invisible character that is available in the current font, but it can be changed with [methodGtk.Text.set_invisible_char].

If you are looking to add icons or progress display in an entry, look at GtkEntry. There other alternatives for more specialized use cases, such as GtkSearchEntry.

If you need multi-line editable text, look at GtkTextView.

CSS nodes

text[.read-only]
├── placeholder
├── undershoot.left
├── undershoot.right
├── [selection]
├── [block-cursor]
╰── [window.popup]

GtkText has a main node with the name text. Depending on the properties of the widget, the .read-only style class may appear.

When the entry has a selection, it adds a subnode with the name selection.

When the entry is in overwrite mode, it adds a subnode with the name block-cursor that determines how the block cursor is drawn.

The CSS node for a context menu is added as a subnode below text as well.

The undershoot nodes are used to draw the underflow indication when content is scrolled out of view. These nodes get the .left and .right style classes added depending on where the indication is drawn.

When touch is used and touch selection handles are shown, they are using CSS nodes with name cursor-handle. They get the .top or .bottom style class depending on where they are shown in relation to the selection. If there is just a single handle for the text cursor, it gets the style class .insertion-cursor.

Accessibility

GtkText uses the GTK_ACCESSIBLE_ROLE_NONE role, which causes it to be skipped for accessibility. This is because GtkText is expected to be used as a delegate for a GtkEditable implementation that will be represented to accessibility.

The TextProtocol protocol exposes the methods and properties of an underlying GtkText 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 Text. Alternatively, use TextRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkText instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkText instance.

    Default Implementation

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

    Declaration

    Swift

    var text_ptr: UnsafeMutablePointer<GtkText>! { get }
  • Required Initialiser for types conforming to TextProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

Text Class

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

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: TextPropertyName, 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 Text property

    Declaration

    Swift

    @inlinable
    func get(property: TextPropertyName) -> 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 Text property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

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

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

Text signals

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

    Declaration

    Swift

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

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

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

    handler

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

    Return Value

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

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

    Declaration

    Swift

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

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

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

    signalHandler

    The C function to be called on the given signal

    Return Value

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

  • onActivate(flags:handler:) Extension method

    Emitted when the user hits the Enter key.

    The default bindings for this signal are all forms of the <kbd>Enter</kbd> key.

    Note

    This represents the underlying activate signal

    Declaration

    Swift

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

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

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

  • activateSignal Extension method

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

    Declaration

    Swift

    static var activateSignal: TextSignalName { get }
  • onBackspace(flags:handler:) Extension method

    Emitted when the user asks for it.

    This is a keybinding signal.

    The default bindings for this signal are <kbd>Backspace</kbd> and <kbd>Shift</kbd>-<kbd>Backspace</kbd>.

    Note

    This represents the underlying backspace signal

    Declaration

    Swift

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

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

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

  • backspaceSignal Extension method

    Typed backspace signal for using the connect(signal:) methods

    Declaration

    Swift

    static var backspaceSignal: TextSignalName { get }
  • Emitted to copy the selection to the clipboard.

    This is a keybinding signal.

    The default bindings for this signal are <kbd>Ctrl</kbd>-<kbd>c</kbd> and <kbd>Ctrl</kbd>-<kbd>Insert</kbd>.

    Note

    This represents the underlying copy-clipboard signal

    Declaration

    Swift

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

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

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

  • copyClipboardSignal Extension method

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

    Declaration

    Swift

    static var copyClipboardSignal: TextSignalName { get }
  • Emitted to cut the selection to the clipboard.

    This is a keybinding signal.

    The default bindings for this signal are <kbd>Ctrl</kbd>-<kbd>x</kbd> and <kbd>Shift</kbd>-<kbd>Delete</kbd>.

    Note

    This represents the underlying cut-clipboard signal

    Declaration

    Swift

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

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

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

  • cutClipboardSignal Extension method

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

    Declaration

    Swift

    static var cutClipboardSignal: TextSignalName { get }
  • Emitted when the user initiates a text deletion.

    This is a keybinding signal.

    If the type is GTK_DELETE_CHARS, GTK deletes the selection if there is one, otherwise it deletes the requested number of characters.

    The default bindings for this signal are <kbd>Delete</kbd> for deleting a character and <kbd>Ctrl</kbd>-<kbd>Delete</kbd> for deleting a word.

    Note

    This represents the underlying delete-from-cursor signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onDeleteFromCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ type: DeleteType, _ count: Int) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    type

    the granularity of the deletion, as a GtkDeleteType

    count

    the number of type units to delete

    handler

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

  • deleteFromCursorSignal Extension method

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

    Declaration

    Swift

    static var deleteFromCursorSignal: TextSignalName { get }
  • Emitted when the user initiates the insertion of a fixed string at the cursor.

    This is a keybinding signal.

    This signal has no default bindings.

    Note

    This represents the underlying insert-at-cursor signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onInsertAtCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ string: String) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    string

    the string to insert

    handler

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

  • insertAtCursorSignal Extension method

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

    Declaration

    Swift

    static var insertAtCursorSignal: TextSignalName { get }
  • Emitted to present the Emoji chooser for the widget.

    This is a keybinding signal.

    The default bindings for this signal are <kbd>Ctrl</kbd>-<kbd>.</kbd> and <kbd>Ctrl</kbd>-<kbd>;</kbd>

    Note

    This represents the underlying insert-emoji signal

    Declaration

    Swift

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

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

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

  • insertEmojiSignal Extension method

    Typed insert-emoji signal for using the connect(signal:) methods

    Declaration

    Swift

    static var insertEmojiSignal: TextSignalName { get }
  • onMoveCursor(flags:handler:) Extension method

    Emitted when the user initiates a cursor movement.

    If the cursor is not visible in self, this signal causes the viewport to be moved instead.

    This is a keybinding signal.

    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 <kbd>Shift</kbd> modifier extends the selection, the variant without it does not. There are too many key combinations to list them all here.

    • <kbd>←</kbd>, <kbd>→</kbd>, <kbd>↑</kbd>, <kbd>↓</kbd> move by individual characters/lines
    • <kbd>Ctrl</kbd>-<kbd>→</kbd>, etc. move by words/paragraphs
    • <kbd>Home</kbd>, <kbd>End</kbd> move to the ends of the buffer

    Note

    This represents the underlying move-cursor signal

    Declaration

    Swift

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

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    step

    the granularity of the move, as a GtkMovementStep

    count

    the number of step units to move

    extend

    true if the move should extend the selection

    handler

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

  • moveCursorSignal Extension method

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

    Declaration

    Swift

    static var moveCursorSignal: TextSignalName { get }
  • Emitted to paste the contents of the clipboard.

    This is a keybinding signal.

    The default bindings for this signal are <kbd>Ctrl</kbd>-<kbd>v</kbd> and <kbd>Shift</kbd>-<kbd>Insert</kbd>.

    Note

    This represents the underlying paste-clipboard signal

    Declaration

    Swift

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

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

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

  • pasteClipboardSignal Extension method

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

    Declaration

    Swift

    static var pasteClipboardSignal: TextSignalName { get }
  • Emitted when the preedit text changes.

    If an input method is used, the typed text will not immediately be committed to the buffer. So if you are interested in the text, connect to this signal.

    Note

    This represents the underlying preedit-changed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onPreeditChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ preedit: String) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    preedit

    the current preedit string

    handler

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

  • preeditChangedSignal Extension method

    Typed preedit-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var preeditChangedSignal: TextSignalName { get }
  • Emitted to toggle the overwrite mode of the GtkText.

    This is a keybinding signal.

    The default bindings for this signal is <kbd>Insert</kbd>.

    Note

    This represents the underlying toggle-overwrite signal

    Declaration

    Swift

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

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

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

  • toggleOverwriteSignal Extension method

    Typed toggle-overwrite signal for using the connect(signal:) methods

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::activates-default signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyActivatesDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyActivatesDefault signal is emitted

  • notifyActivatesDefaultSignal Extension method

    Typed notify::activates-default signal for using the connect(signal:) methods

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::attributes signal

    Declaration

    Swift

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

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

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

  • notifyAttributesSignal Extension method

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

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::buffer signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyBuffer(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyBuffer signal is emitted

  • notifyBufferSignal Extension method

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

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::enable-emoji-completion signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyEnableEmojiCompletion(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyEnableEmojiCompletion signal is emitted

  • Typed notify::enable-emoji-completion signal for using the connect(signal:) methods

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::extra-menu signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyExtraMenu(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyExtraMenu signal is emitted

  • notifyExtraMenuSignal Extension method

    Typed notify::extra-menu signal for using the connect(signal:) methods

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::im-module signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyImModule(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyImModule signal is emitted

  • notifyImModuleSignal Extension method

    Typed notify::im-module signal for using the connect(signal:) methods

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::input-hints signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyInputHints(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyInputHints signal is emitted

  • notifyInputHintsSignal Extension method

    Typed notify::input-hints signal for using the connect(signal:) methods

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::input-purpose signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyInputPurpose(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyInputPurpose signal is emitted

  • notifyInputPurposeSignal Extension method

    Typed notify::input-purpose signal for using the connect(signal:) methods

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::invisible-char signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyInvisibleChar(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyInvisibleChar signal is emitted

  • notifyInvisibleCharSignal Extension method

    Typed notify::invisible-char signal for using the connect(signal:) methods

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::invisible-char-set signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyInvisibleCharSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyInvisibleCharSet signal is emitted

  • notifyInvisibleCharSetSignal Extension method

    Typed notify::invisible-char-set signal for using the connect(signal:) methods

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::max-length signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyMaxLength(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyMaxLength signal is emitted

  • notifyMaxLengthSignal Extension method

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

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::overwrite-mode signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyOverwriteMode(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyOverwriteMode signal is emitted

  • notifyOverwriteModeSignal Extension method

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

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::placeholder-text signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyPlaceholderText(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyPlaceholderText signal is emitted

  • notifyPlaceholderTextSignal Extension method

    Typed notify::placeholder-text signal for using the connect(signal:) methods

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::propagate-text-width signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyPropagateTextWidth(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyPropagateTextWidth signal is emitted

  • Typed notify::propagate-text-width signal for using the connect(signal:) methods

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::scroll-offset signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyScrollOffset(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyScrollOffset signal is emitted

  • notifyScrollOffsetSignal Extension method

    Typed notify::scroll-offset signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyScrollOffsetSignal: TextSignalName { get }
  • onNotifyTabs(flags:handler:) Extension method

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::tabs signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyTabs(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyTabs signal is emitted

  • notifyTabsSignal Extension method

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

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::truncate-multiline signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyTruncateMultiline(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyTruncateMultiline signal is emitted

  • Typed notify::truncate-multiline signal for using the connect(signal:) methods

    Declaration

    Swift

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

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

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

    (C Language Example):

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

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

    Note

    This represents the underlying notify::visibility signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyVisibility(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ 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 notifyVisibility signal is emitted

  • notifyVisibilitySignal Extension method

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

    Declaration

    Swift

    static var notifyVisibilitySignal: TextSignalName { get }

Text Class: TextProtocol extension (methods and fields)

  • Determine the positions of the strong and weak cursors if the insertion point in the layout is at position.

    The position of each cursor is stored as a zero-width rectangle. The strong cursor location is the location where characters of the directionality equal to the base direction are inserted. The weak cursor location is the location where characters of the directionality opposite to the base direction are inserted.

    The rectangle positions are in widget coordinates.

    Declaration

    Swift

    @inlinable
    func computeCursorExtents(position: Int, strong: UnsafeMutablePointer<graphene_rect_t>! = nil, weak: UnsafeMutablePointer<graphene_rect_t>! = nil)
  • getActivatesDefault() Extension method

    Returns whether pressing Enter will activate the default widget for the window containing self.

    See [methodGtk.Text.set_activates_default].

    Declaration

    Swift

    @inlinable
    func getActivatesDefault() -> Bool
  • getAttributes() Extension method

    Gets the attribute list that was set on the GtkText.

    See [methodGtk.Text.set_attributes].

    Declaration

    Swift

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

    Get the GtkEntryBuffer object which holds the text for this widget.

    Declaration

    Swift

    @inlinable
    func getBuffer() -> EntryBufferRef!
  • getEnableEmojiCompletion() Extension method

    Returns whether Emoji completion is enabled for this GtkText widget.

    Declaration

    Swift

    @inlinable
    func getEnableEmojiCompletion() -> Bool
  • getExtraMenu() Extension method

    Gets the menu model for extra items in the context menu.

    See [methodGtk.Text.set_extra_menu].

    Declaration

    Swift

    @inlinable
    func getExtraMenu() -> GIO.MenuModelRef!
  • getInputHints() Extension method

    Gets the input hints of the GtkText.

    Declaration

    Swift

    @inlinable
    func getInputHints() -> InputHints
  • getInputPurpose() Extension method

    Gets the input purpose of the GtkText.

    Declaration

    Swift

    @inlinable
    func getInputPurpose() -> GtkInputPurpose
  • getInvisibleChar() Extension method

    Retrieves the character displayed when visibility is set to false.

    Note that GTK does not compute this value unless it needs it, so the value returned by this function is not very useful unless it has been explicitly set with [methodGtk.Text.set_invisible_char].

    Declaration

    Swift

    @inlinable
    func getInvisibleChar() -> gunichar
  • getMaxLength() Extension method

    Retrieves the maximum allowed length of the text in self.

    See [methodGtk.Text.set_max_length].

    This is equivalent to getting self‘s GtkEntryBuffer and calling [methodGtk.EntryBuffer.get_max_length] on it.

    Declaration

    Swift

    @inlinable
    func getMaxLength() -> Int
  • getOverwriteMode() Extension method

    Gets whether text is overwritten when typing in the GtkText.

    See [methodGtk.Text.set_overwrite_mode].

    Declaration

    Swift

    @inlinable
    func getOverwriteMode() -> Bool
  • getPlaceholderText() Extension method

    Retrieves the text that will be displayed when self is empty and unfocused

    If no placeholder text has been set, nil will be returned.

    Declaration

    Swift

    @inlinable
    func getPlaceholderText() -> String!
  • getPropagateTextWidth() Extension method

    Returns whether the GtkText will grow and shrink with the content.

    Declaration

    Swift

    @inlinable
    func getPropagateTextWidth() -> Bool
  • getTabs() Extension method

    Gets the tabstops that were set on the GtkText.

    See [methodGtk.Text.set_tabs].

    Declaration

    Swift

    @inlinable
    func getTabs() -> Pango.TabArrayRef!
  • getTextLength() Extension method

    Retrieves the current length of the text in self.

    This is equivalent to getting self‘s GtkEntryBuffer and calling [methodGtk.EntryBuffer.get_length] on it.

    Declaration

    Swift

    @inlinable
    func getTextLength() -> guint16
  • getTruncateMultiline() Extension method

    Returns whether the GtkText will truncate multi-line text that is pasted into the widget

    Declaration

    Swift

    @inlinable
    func getTruncateMultiline() -> Bool
  • getVisibility() Extension method

    Retrieves whether the text in self is visible.

    Declaration

    Swift

    @inlinable
    func getVisibility() -> Bool
  • grabFocusWithoutSelecting() Extension method

    Causes self to have keyboard focus.

    It behaves like [methodGtk.Widget.grab_focus], except that it doesn’t select the contents of self. You only want to call this on some special entries which the user usually doesn’t want to replace all text in, such as search-as-you-type entries.

    Declaration

    Swift

    @inlinable
    func grabFocusWithoutSelecting() -> Bool
  • If activates is true, pressing Enter will activate the default widget for the window containing self.

    This usually means that the dialog containing the GtkText will be closed, since the default widget is usually one of the dialog buttons.

    Declaration

    Swift

    @inlinable
    func setActivatesDefault(activates: Bool)
  • setAttributes(attrs:) Extension method

    Sets attributes that are applied to the text.

    Declaration

    Swift

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

    Sets attributes that are applied to the text.

    Declaration

    Swift

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

    Set the GtkEntryBuffer object which holds the text for this widget.

    Declaration

    Swift

    @inlinable
    func set<EntryBufferT>(buffer: EntryBufferT) where EntryBufferT : EntryBufferProtocol
  • set(enableEmojiCompletion:) Extension method

    Sets whether Emoji completion is enabled.

    If it is, typing ‘:’, followed by a recognized keyword, will pop up a window with suggested Emojis matching the keyword.

    Declaration

    Swift

    @inlinable
    func set(enableEmojiCompletion: Bool)
  • setExtraMenu(model:) Extension method

    Sets a menu model to add when constructing the context menu for self.

    Declaration

    Swift

    @inlinable
    func setExtraMenu(model: GIO.MenuModelRef? = nil)
  • setExtraMenu(model:) Extension method

    Sets a menu model to add when constructing the context menu for self.

    Declaration

    Swift

    @inlinable
    func setExtraMenu<MenuModelT>(model: MenuModelT?) where MenuModelT : MenuModelProtocol
  • setInput(hints:) Extension method

    Sets input hints that allow input methods to fine-tune their behaviour.

    Declaration

    Swift

    @inlinable
    func setInput(hints: InputHints)
  • setInput(purpose:) Extension method

    Sets the input purpose of the GtkText.

    This can be used by on-screen keyboards and other input methods to adjust their behaviour.

    Declaration

    Swift

    @inlinable
    func setInput(purpose: GtkInputPurpose)
  • setInvisibleChar(ch:) Extension method

    Sets the character to use when in “password mode”.

    By default, GTK picks the best invisible char available in the current font. If you set the invisible char to 0, then the user will get no feedback at all; there will be no text on the screen as they type.

    Declaration

    Swift

    @inlinable
    func setInvisibleChar(ch: gunichar)
  • setMax(length:) Extension method

    Sets the maximum allowed length of the contents of the widget.

    If the current contents are longer than the given length, then they will be truncated to fit.

    This is equivalent to getting self‘s GtkEntryBuffer and calling [methodGtk.EntryBuffer.set_max_length] on it.

    Declaration

    Swift

    @inlinable
    func setMax(length: Int)
  • setOverwriteMode(overwrite:) Extension method

    Sets whether the text is overwritten when typing in the GtkText.

    Declaration

    Swift

    @inlinable
    func setOverwriteMode(overwrite: Bool)
  • setPlaceholder(text:) Extension method

    Sets text to be displayed in self when it is empty.

    This can be used to give a visual hint of the expected contents of the GtkText.

    Declaration

    Swift

    @inlinable
    func setPlaceholder(text: UnsafePointer<CChar>? = nil)
  • set(propagateTextWidth:) Extension method

    Sets whether the GtkText should grow and shrink with the content.

    Declaration

    Swift

    @inlinable
    func set(propagateTextWidth: Bool)
  • set(tabs:) Extension method

    Sets tabstops that are applied to the text.

    Declaration

    Swift

    @inlinable
    func set(tabs: Pango.TabArrayRef? = nil)
  • set(tabs:) Extension method

    Sets tabstops that are applied to the text.

    Declaration

    Swift

    @inlinable
    func set<TabArrayT>(tabs: TabArrayT?) where TabArrayT : TabArrayProtocol
  • set(truncateMultiline:) Extension method

    Sets whether the GtkText should truncate multi-line text that is pasted into the widget.

    Declaration

    Swift

    @inlinable
    func set(truncateMultiline: Bool)
  • setVisibility(visible:) Extension method

    Sets whether the contents of the GtkText are visible or not.

    When visibility is set to false, characters are displayed as the invisible char, and will also appear that way when the text in the widget is copied to the clipboard.

    By default, GTK picks the best invisible character available in the current font, but it can be changed with [methodGtk.Text.set_invisible_char].

    Note that you probably want to set [propertyGtk.Text:input-purpose] to GTK_INPUT_PURPOSE_PASSWORD or GTK_INPUT_PURPOSE_PIN to inform input methods about the purpose of this self, in addition to setting visibility to false.

    Declaration

    Swift

    @inlinable
    func setVisibility(visible: Bool)
  • unsetInvisibleChar() Extension method

    Unsets the invisible char.

    After calling this, the default invisible char is used again.

    Declaration

    Swift

    @inlinable
    func unsetInvisibleChar()
  • activatesDefault Extension method

    Returns whether pressing Enter will activate the default widget for the window containing self.

    See [methodGtk.Text.set_activates_default].

    Declaration

    Swift

    @inlinable
    var activatesDefault: Bool { get nonmutating set }
  • attributes Extension method

    A list of Pango attributes to apply to the text of the GtkText.

    This is mainly useful to change the size or weight of the text.

    The PangoAttribute‘s start_index and end_index must refer to the GtkEntryBuffer text, i.e. without the preedit string.

    Declaration

    Swift

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

    The GtkEntryBuffer object which stores the text.

    Declaration

    Swift

    @inlinable
    var buffer: EntryBufferRef! { get nonmutating set }
  • enableEmojiCompletion Extension method

    Returns whether Emoji completion is enabled for this GtkText widget.

    Declaration

    Swift

    @inlinable
    var enableEmojiCompletion: Bool { get nonmutating set }
  • extraMenu Extension method

    Gets the menu model for extra items in the context menu.

    See [methodGtk.Text.set_extra_menu].

    Declaration

    Swift

    @inlinable
    var extraMenu: GIO.MenuModelRef! { get nonmutating set }
  • inputHints Extension method

    Gets the input hints of the GtkText.

    Declaration

    Swift

    @inlinable
    var inputHints: InputHints { get nonmutating set }
  • inputPurpose Extension method

    Gets the input purpose of the GtkText.

    Declaration

    Swift

    @inlinable
    var inputPurpose: GtkInputPurpose { get nonmutating set }
  • invisibleChar Extension method

    Retrieves the character displayed when visibility is set to false.

    Note that GTK does not compute this value unless it needs it, so the value returned by this function is not very useful unless it has been explicitly set with [methodGtk.Text.set_invisible_char].

    Declaration

    Swift

    @inlinable
    var invisibleChar: gunichar { get nonmutating set }
  • maxLength Extension method

    Retrieves the maximum allowed length of the text in self.

    See [methodGtk.Text.set_max_length].

    This is equivalent to getting self‘s GtkEntryBuffer and calling [methodGtk.EntryBuffer.get_max_length] on it.

    Declaration

    Swift

    @inlinable
    var maxLength: Int { get nonmutating set }
  • overwriteMode Extension method

    Gets whether text is overwritten when typing in the GtkText.

    See [methodGtk.Text.set_overwrite_mode].

    Declaration

    Swift

    @inlinable
    var overwriteMode: Bool { get nonmutating set }
  • placeholderText Extension method

    Retrieves the text that will be displayed when self is empty and unfocused

    If no placeholder text has been set, nil will be returned.

    Declaration

    Swift

    @inlinable
    var placeholderText: String! { get nonmutating set }
  • propagateTextWidth Extension method

    Returns whether the GtkText will grow and shrink with the content.

    Declaration

    Swift

    @inlinable
    var propagateTextWidth: Bool { get nonmutating set }
  • tabs Extension method

    A list of tabstops to apply to the text of the GtkText.

    Declaration

    Swift

    @inlinable
    var tabs: Pango.TabArrayRef! { get nonmutating set }
  • textLength Extension method

    Retrieves the current length of the text in self.

    This is equivalent to getting self‘s GtkEntryBuffer and calling [methodGtk.EntryBuffer.get_length] on it.

    Declaration

    Swift

    @inlinable
    var textLength: guint16 { get }
  • truncateMultiline Extension method

    Returns whether the GtkText will truncate multi-line text that is pasted into the widget

    Declaration

    Swift

    @inlinable
    var truncateMultiline: Bool { get nonmutating set }
  • visibility Extension method

    If false, the text is masked with the “invisible char”.

    Declaration

    Swift

    @inlinable
    var visibility: Bool { get nonmutating set }