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.
-
Untyped pointer to the underlying
GtkText
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
text_ptr
Default implementationTyped 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)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) 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 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 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:
Extension methodvalue: ) 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
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
TextSignalName
signalDeclaration
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 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
TextSignalName
signalDeclaration
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 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)
-
onActivate(flags:
Extension methodhandler: ) 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 underlyingactivate
signalDeclaration
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 methodTyped
activate
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var activateSignal: TextSignalName { get }
-
onBackspace(flags:
Extension methodhandler: ) 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 underlyingbackspace
signalDeclaration
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 methodTyped
backspace
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var backspaceSignal: TextSignalName { get }
-
onCopyClipboard(flags:
Extension methodhandler: ) 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 underlyingcopy-clipboard
signalDeclaration
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 methodTyped
copy-clipboard
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var copyClipboardSignal: TextSignalName { get }
-
onCutClipboard(flags:
Extension methodhandler: ) 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 underlyingcut-clipboard
signalDeclaration
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 methodTyped
cut-clipboard
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var cutClipboardSignal: TextSignalName { get }
-
onDeleteFromCursor(flags:
Extension methodhandler: ) Emitted when the user initiates a text deletion.
This is a keybinding signal.
If the
type
isGTK_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 underlyingdelete-from-cursor
signalDeclaration
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 deletehandler
The signal handler to call Run the given callback whenever the
deleteFromCursor
signal is emitted -
deleteFromCursorSignal
Extension methodTyped
delete-from-cursor
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var deleteFromCursorSignal: TextSignalName { get }
-
onInsertAtCursor(flags:
Extension methodhandler: ) 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 underlyinginsert-at-cursor
signalDeclaration
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 methodTyped
insert-at-cursor
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var insertAtCursorSignal: TextSignalName { get }
-
onInsertEmoji(flags:
Extension methodhandler: ) 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 underlyinginsert-emoji
signalDeclaration
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 methodTyped
insert-emoji
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var insertEmojiSignal: TextSignalName { get }
-
onMoveCursor(flags:
Extension methodhandler: ) 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 underlyingmove-cursor
signalDeclaration
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 moveextend
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: TextSignalName { get }
-
onPasteClipboard(flags:
Extension methodhandler: ) 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 underlyingpaste-clipboard
signalDeclaration
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 methodTyped
paste-clipboard
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var pasteClipboardSignal: TextSignalName { get }
-
onPreeditChanged(flags:
Extension methodhandler: ) 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 underlyingpreedit-changed
signalDeclaration
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 methodTyped
preedit-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var preeditChangedSignal: TextSignalName { get }
-
onToggleOverwrite(flags:
Extension methodhandler: ) 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 underlyingtoggle-overwrite
signalDeclaration
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 methodTyped
toggle-overwrite
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var toggleOverwriteSignal: TextSignalName { get }
-
onNotifyActivatesDefault(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::activates-default
signalDeclaration
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 methodTyped
notify::activates-default
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyActivatesDefaultSignal: TextSignalName { 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: 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 methodTyped
notify::attributes
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyAttributesSignal: TextSignalName { get }
-
onNotifyBuffer(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::buffer
signalDeclaration
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 methodTyped
notify::buffer
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyBufferSignal: TextSignalName { get }
-
onNotifyEnableEmojiCompletion(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::enable-emoji-completion
signalDeclaration
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 -
notifyEnableEmojiCompletionSignal
Extension methodTyped
notify::enable-emoji-completion
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyEnableEmojiCompletionSignal: TextSignalName { get }
-
onNotifyExtraMenu(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::extra-menu
signalDeclaration
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 methodTyped
notify::extra-menu
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyExtraMenuSignal: TextSignalName { get }
-
onNotifyImModule(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::im-module
signalDeclaration
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 methodTyped
notify::im-module
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyImModuleSignal: TextSignalName { get }
-
onNotifyInputHints(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::input-hints
signalDeclaration
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 methodTyped
notify::input-hints
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyInputHintsSignal: TextSignalName { get }
-
onNotifyInputPurpose(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::input-purpose
signalDeclaration
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 methodTyped
notify::input-purpose
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyInputPurposeSignal: TextSignalName { get }
-
onNotifyInvisibleChar(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::invisible-char
signalDeclaration
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 methodTyped
notify::invisible-char
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyInvisibleCharSignal: TextSignalName { get }
-
onNotifyInvisibleCharSet(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::invisible-char-set
signalDeclaration
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 methodTyped
notify::invisible-char-set
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyInvisibleCharSetSignal: TextSignalName { get }
-
onNotifyMaxLength(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-length
signalDeclaration
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 methodTyped
notify::max-length
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyMaxLengthSignal: TextSignalName { get }
-
onNotifyOverwriteMode(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::overwrite-mode
signalDeclaration
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 methodTyped
notify::overwrite-mode
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyOverwriteModeSignal: TextSignalName { get }
-
onNotifyPlaceholderText(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::placeholder-text
signalDeclaration
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 methodTyped
notify::placeholder-text
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyPlaceholderTextSignal: TextSignalName { get }
-
onNotifyPropagateTextWidth(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::propagate-text-width
signalDeclaration
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 -
notifyPropagateTextWidthSignal
Extension methodTyped
notify::propagate-text-width
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyPropagateTextWidthSignal: TextSignalName { get }
-
onNotifyScrollOffset(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::scroll-offset
signalDeclaration
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 methodTyped
notify::scroll-offset
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyScrollOffsetSignal: TextSignalName { get }
-
onNotifyTabs(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::tabs
signalDeclaration
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 methodTyped
notify::tabs
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyTabsSignal: TextSignalName { get }
-
onNotifyTruncateMultiline(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::truncate-multiline
signalDeclaration
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 -
notifyTruncateMultilineSignal
Extension methodTyped
notify::truncate-multiline
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyTruncateMultilineSignal: TextSignalName { get }
-
onNotifyVisibility(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::visibility
signalDeclaration
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 methodTyped
notify::visibility
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyVisibilitySignal: TextSignalName { get }
-
computeCursorExtents(position:
Extension methodstrong: weak: ) 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 methodReturns whether pressing Enter will activate the default widget for the window containing
self
.See [method
Gtk.Text.set_activates_default
].Declaration
Swift
@inlinable func getActivatesDefault() -> Bool
-
getAttributes()
Extension methodGets the attribute list that was set on the
GtkText
.See [method
Gtk.Text.set_attributes
].Declaration
Swift
@inlinable func getAttributes() -> Pango.AttrListRef!
-
getBuffer()
Extension methodGet the
GtkEntryBuffer
object which holds the text for this widget.Declaration
Swift
@inlinable func getBuffer() -> EntryBufferRef!
-
getEnableEmojiCompletion()
Extension methodReturns whether Emoji completion is enabled for this
GtkText
widget.Declaration
Swift
@inlinable func getEnableEmojiCompletion() -> Bool
-
getExtraMenu()
Extension methodGets the menu model for extra items in the context menu.
See [method
Gtk.Text.set_extra_menu
].Declaration
Swift
@inlinable func getExtraMenu() -> GIO.MenuModelRef!
-
getInputHints()
Extension methodGets the input hints of the
GtkText
.Declaration
Swift
@inlinable func getInputHints() -> InputHints
-
getInputPurpose()
Extension methodGets the input purpose of the
GtkText
.Declaration
Swift
@inlinable func getInputPurpose() -> GtkInputPurpose
-
getInvisibleChar()
Extension methodRetrieves 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 [method
Gtk.Text.set_invisible_char
].Declaration
Swift
@inlinable func getInvisibleChar() -> gunichar
-
getMaxLength()
Extension methodRetrieves the maximum allowed length of the text in
self
.See [method
Gtk.Text.set_max_length
].This is equivalent to getting
self
‘sGtkEntryBuffer
and calling [methodGtk.EntryBuffer.get_max_length
] on it.Declaration
Swift
@inlinable func getMaxLength() -> Int
-
getOverwriteMode()
Extension methodGets whether text is overwritten when typing in the
GtkText
.See [method
Gtk.Text.set_overwrite_mode
].Declaration
Swift
@inlinable func getOverwriteMode() -> Bool
-
getPlaceholderText()
Extension methodRetrieves the text that will be displayed when
self
is empty and unfocusedIf no placeholder text has been set,
nil
will be returned.Declaration
Swift
@inlinable func getPlaceholderText() -> String!
-
getPropagateTextWidth()
Extension methodReturns whether the
GtkText
will grow and shrink with the content.Declaration
Swift
@inlinable func getPropagateTextWidth() -> Bool
-
getTabs()
Extension methodGets the tabstops that were set on the
GtkText
.See [method
Gtk.Text.set_tabs
].Declaration
Swift
@inlinable func getTabs() -> Pango.TabArrayRef!
-
getTextLength()
Extension methodRetrieves the current length of the text in
self
.This is equivalent to getting
self
‘sGtkEntryBuffer
and calling [methodGtk.EntryBuffer.get_length
] on it.Declaration
Swift
@inlinable func getTextLength() -> guint16
-
getTruncateMultiline()
Extension methodReturns whether the
GtkText
will truncate multi-line text that is pasted into the widgetDeclaration
Swift
@inlinable func getTruncateMultiline() -> Bool
-
getVisibility()
Extension methodRetrieves whether the text in
self
is visible.Declaration
Swift
@inlinable func getVisibility() -> Bool
-
grabFocusWithoutSelecting()
Extension methodCauses
self
to have keyboard focus.It behaves like [method
Gtk.Widget.grab_focus
], except that it doesn’t select the contents ofself
. 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
-
setActivatesDefault(activates:
Extension method) If
activates
istrue
, pressing Enter will activate the default widget for the window containingself
.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
‘sGtkEntryBuffer
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 [method
Gtk.Text.set_invisible_char
].Note that you probably want to set [property
Gtk.Text:input-purpose
] toGTK_INPUT_PURPOSE_PASSWORD
orGTK_INPUT_PURPOSE_PIN
to inform input methods about the purpose of this self, in addition to setting visibility tofalse
.Declaration
Swift
@inlinable func setVisibility(visible: Bool)
-
unsetInvisibleChar()
Extension methodUnsets the invisible char.
After calling this, the default invisible char is used again.
Declaration
Swift
@inlinable func unsetInvisibleChar()
-
activatesDefault
Extension methodReturns whether pressing Enter will activate the default widget for the window containing
self
.See [method
Gtk.Text.set_activates_default
].Declaration
Swift
@inlinable var activatesDefault: Bool { get nonmutating set }
-
attributes
Extension methodA 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
‘sstart_index
andend_index
must refer to theGtkEntryBuffer
text, i.e. without the preedit string.Declaration
Swift
@inlinable var attributes: Pango.AttrListRef! { get nonmutating set }
-
buffer
Extension methodThe
GtkEntryBuffer
object which stores the text.Declaration
Swift
@inlinable var buffer: EntryBufferRef! { get nonmutating set }
-
enableEmojiCompletion
Extension methodReturns whether Emoji completion is enabled for this
GtkText
widget.Declaration
Swift
@inlinable var enableEmojiCompletion: Bool { get nonmutating set }
-
extraMenu
Extension methodGets the menu model for extra items in the context menu.
See [method
Gtk.Text.set_extra_menu
].Declaration
Swift
@inlinable var extraMenu: GIO.MenuModelRef! { get nonmutating set }
-
inputHints
Extension methodGets the input hints of the
GtkText
.Declaration
Swift
@inlinable var inputHints: InputHints { get nonmutating set }
-
inputPurpose
Extension methodGets the input purpose of the
GtkText
.Declaration
Swift
@inlinable var inputPurpose: GtkInputPurpose { get nonmutating set }
-
invisibleChar
Extension methodRetrieves 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 [method
Gtk.Text.set_invisible_char
].Declaration
Swift
@inlinable var invisibleChar: gunichar { get nonmutating set }
-
maxLength
Extension methodRetrieves the maximum allowed length of the text in
self
.See [method
Gtk.Text.set_max_length
].This is equivalent to getting
self
‘sGtkEntryBuffer
and calling [methodGtk.EntryBuffer.get_max_length
] on it.Declaration
Swift
@inlinable var maxLength: Int { get nonmutating set }
-
overwriteMode
Extension methodGets whether text is overwritten when typing in the
GtkText
.See [method
Gtk.Text.set_overwrite_mode
].Declaration
Swift
@inlinable var overwriteMode: Bool { get nonmutating set }
-
placeholderText
Extension methodRetrieves the text that will be displayed when
self
is empty and unfocusedIf no placeholder text has been set,
nil
will be returned.Declaration
Swift
@inlinable var placeholderText: String! { get nonmutating set }
-
propagateTextWidth
Extension methodReturns whether the
GtkText
will grow and shrink with the content.Declaration
Swift
@inlinable var propagateTextWidth: Bool { get nonmutating set }
-
tabs
Extension methodA list of tabstops to apply to the text of the
GtkText
.Declaration
Swift
@inlinable var tabs: Pango.TabArrayRef! { get nonmutating set }
-
textLength
Extension methodRetrieves the current length of the text in
self
.This is equivalent to getting
self
‘sGtkEntryBuffer
and calling [methodGtk.EntryBuffer.get_length
] on it.Declaration
Swift
@inlinable var textLength: guint16 { get }
-
truncateMultiline
Extension methodReturns whether the
GtkText
will truncate multi-line text that is pasted into the widgetDeclaration
Swift
@inlinable var truncateMultiline: Bool { get nonmutating set }
-
visibility
Extension methodIf
false
, the text is masked with the “invisible char”.Declaration
Swift
@inlinable var visibility: Bool { get nonmutating set }