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
GtkTextinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
text_ptrDefault implementationTyped pointer to the underlying
GtkTextinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkTextinstance.Declaration
Swift
var text_ptr: UnsafeMutablePointer<GtkText>! { get } -
Required Initialiser for types conforming to
TextProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
TextPropertyNamesource 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 : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a Text property
Declaration
Swift
@inlinable func get(property: TextPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a 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
propertythe 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
TextSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: TextSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe 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
TextSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: TextSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe 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 underlyingactivatesignalDeclaration
Swift
@discardableResult @inlinable func onActivate(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
activatesignal is emitted -
activateSignalExtension methodTyped
activatesignal 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 underlyingbackspacesignalDeclaration
Swift
@discardableResult @inlinable func onBackspace(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
backspacesignal is emitted -
backspaceSignalExtension methodTyped
backspacesignal 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-clipboardsignalDeclaration
Swift
@discardableResult @inlinable func onCopyClipboard(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
copyClipboardsignal is emitted -
copyClipboardSignalExtension methodTyped
copy-clipboardsignal 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-clipboardsignalDeclaration
Swift
@discardableResult @inlinable func onCutClipboard(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
cutClipboardsignal is emitted -
cutClipboardSignalExtension methodTyped
cut-clipboardsignal 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
typeisGTK_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-cursorsignalDeclaration
Swift
@discardableResult @inlinable func onDeleteFromCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ type: DeleteType, _ count: Int) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
typethe granularity of the deletion, as a
GtkDeleteTypecountthe number of
typeunits to deletehandlerThe signal handler to call Run the given callback whenever the
deleteFromCursorsignal is emitted -
deleteFromCursorSignalExtension methodTyped
delete-from-cursorsignal 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-cursorsignalDeclaration
Swift
@discardableResult @inlinable func onInsertAtCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ string: String) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
stringthe string to insert
handlerThe signal handler to call Run the given callback whenever the
insertAtCursorsignal is emitted -
insertAtCursorSignalExtension methodTyped
insert-at-cursorsignal 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-emojisignalDeclaration
Swift
@discardableResult @inlinable func onInsertEmoji(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
insertEmojisignal is emitted -
insertEmojiSignalExtension methodTyped
insert-emojisignal 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-cursorsignalDeclaration
Swift
@discardableResult @inlinable func onMoveCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ step: MovementStep, _ count: Int, _ extend: Bool) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
stepthe granularity of the move, as a
GtkMovementStepcountthe number of
stepunits to moveextendtrueif the move should extend the selectionhandlerThe signal handler to call Run the given callback whenever the
moveCursorsignal is emitted -
moveCursorSignalExtension methodTyped
move-cursorsignal 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-clipboardsignalDeclaration
Swift
@discardableResult @inlinable func onPasteClipboard(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
pasteClipboardsignal is emitted -
pasteClipboardSignalExtension methodTyped
paste-clipboardsignal 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-changedsignalDeclaration
Swift
@discardableResult @inlinable func onPreeditChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ preedit: String) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
preeditthe current preedit string
handlerThe signal handler to call Run the given callback whenever the
preeditChangedsignal is emitted -
preeditChangedSignalExtension methodTyped
preedit-changedsignal 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-overwritesignalDeclaration
Swift
@discardableResult @inlinable func onToggleOverwrite(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
toggleOverwritesignal is emitted -
toggleOverwriteSignalExtension methodTyped
toggle-overwritesignal 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 innotifybeing 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-defaultsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyActivatesDefault(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyActivatesDefaultsignal is emitted -
notifyActivatesDefaultSignalExtension methodTyped
notify::activates-defaultsignal 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 innotifybeing 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::attributessignalDeclaration
Swift
@discardableResult @inlinable func onNotifyAttributes(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyAttributessignal is emitted -
notifyAttributesSignalExtension methodTyped
notify::attributessignal 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 innotifybeing 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::buffersignalDeclaration
Swift
@discardableResult @inlinable func onNotifyBuffer(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyBuffersignal is emitted -
notifyBufferSignalExtension methodTyped
notify::buffersignal 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 innotifybeing 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-completionsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyEnableEmojiCompletion(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyEnableEmojiCompletionsignal is emitted -
notifyEnableEmojiCompletionSignalExtension methodTyped
notify::enable-emoji-completionsignal 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 innotifybeing 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-menusignalDeclaration
Swift
@discardableResult @inlinable func onNotifyExtraMenu(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyExtraMenusignal is emitted -
notifyExtraMenuSignalExtension methodTyped
notify::extra-menusignal 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 innotifybeing 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-modulesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyImModule(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyImModulesignal is emitted -
notifyImModuleSignalExtension methodTyped
notify::im-modulesignal 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 innotifybeing 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-hintssignalDeclaration
Swift
@discardableResult @inlinable func onNotifyInputHints(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyInputHintssignal is emitted -
notifyInputHintsSignalExtension methodTyped
notify::input-hintssignal 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 innotifybeing 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-purposesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyInputPurpose(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyInputPurposesignal is emitted -
notifyInputPurposeSignalExtension methodTyped
notify::input-purposesignal 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 innotifybeing 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-charsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyInvisibleChar(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyInvisibleCharsignal is emitted -
notifyInvisibleCharSignalExtension methodTyped
notify::invisible-charsignal 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 innotifybeing 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-setsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyInvisibleCharSet(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyInvisibleCharSetsignal is emitted -
notifyInvisibleCharSetSignalExtension methodTyped
notify::invisible-char-setsignal 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 innotifybeing 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-lengthsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyMaxLength(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyMaxLengthsignal is emitted -
notifyMaxLengthSignalExtension methodTyped
notify::max-lengthsignal 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 innotifybeing 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-modesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyOverwriteMode(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyOverwriteModesignal is emitted -
notifyOverwriteModeSignalExtension methodTyped
notify::overwrite-modesignal 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 innotifybeing 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-textsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyPlaceholderText(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyPlaceholderTextsignal is emitted -
notifyPlaceholderTextSignalExtension methodTyped
notify::placeholder-textsignal 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 innotifybeing 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-widthsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyPropagateTextWidth(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyPropagateTextWidthsignal is emitted -
notifyPropagateTextWidthSignalExtension methodTyped
notify::propagate-text-widthsignal 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 innotifybeing 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-offsetsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyScrollOffset(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyScrollOffsetsignal is emitted -
notifyScrollOffsetSignalExtension methodTyped
notify::scroll-offsetsignal 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 innotifybeing 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::tabssignalDeclaration
Swift
@discardableResult @inlinable func onNotifyTabs(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyTabssignal is emitted -
notifyTabsSignalExtension methodTyped
notify::tabssignal 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 innotifybeing 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-multilinesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyTruncateMultiline(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyTruncateMultilinesignal is emitted -
notifyTruncateMultilineSignalExtension methodTyped
notify::truncate-multilinesignal 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 innotifybeing 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::visibilitysignalDeclaration
Swift
@discardableResult @inlinable func onNotifyVisibility(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyVisibilitysignal is emitted -
notifyVisibilitySignalExtension methodTyped
notify::visibilitysignal 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
GtkEntryBufferobject which holds the text for this widget.Declaration
Swift
@inlinable func getBuffer() -> EntryBufferRef! -
getEnableEmojiCompletion()Extension methodReturns whether Emoji completion is enabled for this
GtkTextwidget.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‘sGtkEntryBufferand 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
selfis empty and unfocusedIf no placeholder text has been set,
nilwill be returned.Declaration
Swift
@inlinable func getPlaceholderText() -> String! -
getPropagateTextWidth()Extension methodReturns whether the
GtkTextwill 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‘sGtkEntryBufferand calling [methodGtk.EntryBuffer.get_length] on it.Declaration
Swift
@inlinable func getTextLength() -> guint16 -
getTruncateMultiline()Extension methodReturns whether the
GtkTextwill truncate multi-line text that is pasted into the widgetDeclaration
Swift
@inlinable func getTruncateMultiline() -> Bool -
getVisibility()Extension methodRetrieves whether the text in
selfis visible.Declaration
Swift
@inlinable func getVisibility() -> Bool -
grabFocusWithoutSelecting()Extension methodCauses
selfto 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
activatesistrue, pressing Enter will activate the default widget for the window containingself.This usually means that the dialog containing the
GtkTextwill 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
GtkEntryBufferobject 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‘sGtkEntryBufferand 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
selfwhen 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
GtkTextshould 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
GtkTextshould 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
GtkTextare 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_PASSWORDorGTK_INPUT_PURPOSE_PINto 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() -
activatesDefaultExtension 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 } -
attributesExtension 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_indexandend_indexmust refer to theGtkEntryBuffertext, i.e. without the preedit string.Declaration
Swift
@inlinable var attributes: Pango.AttrListRef! { get nonmutating set } -
bufferExtension methodThe
GtkEntryBufferobject which stores the text.Declaration
Swift
@inlinable var buffer: EntryBufferRef! { get nonmutating set } -
enableEmojiCompletionExtension methodReturns whether Emoji completion is enabled for this
GtkTextwidget.Declaration
Swift
@inlinable var enableEmojiCompletion: Bool { get nonmutating set } -
extraMenuExtension 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 } -
inputHintsExtension methodGets the input hints of the
GtkText.Declaration
Swift
@inlinable var inputHints: InputHints { get nonmutating set } -
inputPurposeExtension methodGets the input purpose of the
GtkText.Declaration
Swift
@inlinable var inputPurpose: GtkInputPurpose { get nonmutating set } -
invisibleCharExtension 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 } -
maxLengthExtension methodRetrieves the maximum allowed length of the text in
self.See [method
Gtk.Text.set_max_length].This is equivalent to getting
self‘sGtkEntryBufferand calling [methodGtk.EntryBuffer.get_max_length] on it.Declaration
Swift
@inlinable var maxLength: Int { get nonmutating set } -
overwriteModeExtension 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 } -
placeholderTextExtension methodRetrieves the text that will be displayed when
selfis empty and unfocusedIf no placeholder text has been set,
nilwill be returned.Declaration
Swift
@inlinable var placeholderText: String! { get nonmutating set } -
propagateTextWidthExtension methodReturns whether the
GtkTextwill grow and shrink with the content.Declaration
Swift
@inlinable var propagateTextWidth: Bool { get nonmutating set } -
tabsExtension methodA list of tabstops to apply to the text of the
GtkText.Declaration
Swift
@inlinable var tabs: Pango.TabArrayRef! { get nonmutating set } -
textLengthExtension methodRetrieves the current length of the text in
self.This is equivalent to getting
self‘sGtkEntryBufferand calling [methodGtk.EntryBuffer.get_length] on it.Declaration
Swift
@inlinable var textLength: guint16 { get } -
truncateMultilineExtension methodReturns whether the
GtkTextwill truncate multi-line text that is pasted into the widgetDeclaration
Swift
@inlinable var truncateMultiline: Bool { get nonmutating set } -
visibilityExtension methodIf
false, the text is masked with the “invisible char”.Declaration
Swift
@inlinable var visibility: Bool { get nonmutating set }
View on GitHub
Install in Dash
TextProtocol Protocol Reference