Skip to main content

Type Alias: GtkTextProps

GtkTextProps = WidgetProps & object

Defined in: generated/jsx.ts:10031

Props for the GtkText widget.

Type Declaration

NameTypeDescriptionDefined in
activatesDefault?booleanWhether to activate the default widget when Enter is pressed.generated/jsx.ts:10033
attributes?Pango.AttrList | nullA list of Pango attributes to apply to the text. This is mainly useful to change the size or weight of the text. The PangoAttribute's start_index and end_index must refer to the GtkEntryBuffer text, i.e. without the preedit string.generated/jsx.ts:10042
buffer?Gtk.EntryBufferThe GtkEntryBuffer object which stores the text.generated/jsx.ts:10044
editable?booleanWhether the entry contents can be edited.generated/jsx.ts:10101
enableEmojiCompletion?booleanWhether to suggest Emoji replacements.generated/jsx.ts:10046
enableUndo?booleanIf undo/redo should be enabled for the editable.generated/jsx.ts:10103
extraMenu?Gio.MenuModel | nullA menu model whose contents will be appended to the context menu.generated/jsx.ts:10048
imModule?stringWhich input method module should be used. See IMMulticontext. Setting this to a non-NULL value overrides the system-wide input method. See the Settings.gtk-im-module setting.generated/jsx.ts:10058
inputHints?Gtk.InputHintsAdditional hints that allow input methods to fine-tune their behaviour.generated/jsx.ts:10063
inputPurpose?Gtk.InputPurposeThe purpose of this text field. This information can be used by on-screen keyboards and other input methods to adjust their behaviour. Note that setting the purpose to InputPurpose.password or InputPurpose.pin is independent from setting Text.visibility.generated/jsx.ts:10074
invisibleChar?numberThe character to used when masking contents (in “password mode”).generated/jsx.ts:10076
invisibleCharSet?booleanWhether the invisible char has been set.generated/jsx.ts:10078
maxLength?numberMaximum number of characters that are allowed. Zero indicates no limit.generated/jsx.ts:10084
maxWidthChars?numberThe desired maximum width of the entry, in characters.generated/jsx.ts:10105
onActivate()?(self) => void | nullEmitted when the user hits the Enter key. The default bindings for this signal are all forms of the Enter key.generated/jsx.ts:10122
onBackspace()?(self) => void | nullEmitted when the user asks for it. This is a keybinding signal. The default bindings for this signal are Backspace and Shift+Backspace.generated/jsx.ts:10131
onChanged()?(self) => void | nullEmitted at the end of a single user-visible operation on the contents. E.g., a paste operation that replaces the contents of the selection will cause only one signal emission (even though it is implemented by first deleting the selection, then inserting the new content, and may cause multiple ::notify::text signals to be emitted).generated/jsx.ts:10243
onCopyClipboard()?(self) => void | nullEmitted to copy the selection to the clipboard. This is a keybinding signal. The default bindings for this signal are Ctrl+c and Ctrl+Insert.generated/jsx.ts:10141
onCutClipboard()?(self) => void | nullEmitted to cut the selection to the clipboard. This is a keybinding signal. The default bindings for this signal are Ctrl+x and Shift+Delete.generated/jsx.ts:10151
onDeleteFromCursor()?(self, type, count) => void | nullEmitted when the user initiates a text deletion. This is a keybinding signal. If the type is DeleteType.chars, GTK deletes the selection if there is one, otherwise it deletes the requested number of characters. The default bindings for this signal are Delete for deleting a character and Ctrl+Delete for deleting a word.generated/jsx.ts:10165
onDeleteText()?(self, startPos, endPos) => void | nullEmitted when text is deleted from the widget by the user. The default handler for this signal will normally be responsible for deleting the text, so by connecting to this signal and then stopping the signal with g_signal_stop_emission(), it is possible to modify the range of deleted text, or prevent it from being deleted entirely. The start_pos and end_pos parameters are interpreted as for Editable.delete_text.generated/jsx.ts:10255
onInsertAtCursor()?(self, string) => void | nullEmitted when the user initiates the insertion of a fixed string at the cursor. This is a keybinding signal. This signal has no default bindings.generated/jsx.ts:10174
onInsertEmoji()?(self) => void | nullEmitted to present the Emoji chooser. This is a keybinding signal. The default bindings for this signal are Ctrl+. and Ctrl+;generated/jsx.ts:10184
onInsertText()?(self, text, length, position) => void | nullEmitted when text is inserted into the widget by the user. The default handler for this signal will normally be responsible for inserting the text, so by connecting to this signal and then stopping the signal with g_signal_stop_emission(), it is possible to modify the inserted text, or prevent it from being inserted entirely.generated/jsx.ts:10264
onMoveCursor()?(self, step, count, extend) => void | nullEmitted 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 GObjectsignal_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 Shift modifier extends the selection, the variant without it does not. There are too many key combinations to list them all here. - , , , move by individual characters/lines - Ctrl+, etc. move by words/paragraphs - Home and End move to the ends of the buffergenerated/jsx.ts:10207
onNotify?(self, propName) => void | nullCalled when any property on this widget changes. Param The widget that emitted the notification Param The name of the property that changed (in kebab-case)generated/jsx.ts:10270
onPasteClipboard()?(self) => void | nullEmitted to paste the contents of the clipboard. This is a keybinding signal. The default bindings for this signal are Ctrl+v and Shift+Insert.generated/jsx.ts:10216
onPreeditChanged()?(self, preedit) => void | nullEmitted 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.generated/jsx.ts:10224
onToggleOverwrite()?(self) => void | nullEmitted to toggle the overwrite mode. This is a keybinding signal. The default bindings for this signal is Insert.generated/jsx.ts:10232
overwriteMode?booleanIf text is overwritten when typing.generated/jsx.ts:10086
placeholderText?string | nullThe text that will be displayed in the GtkText when it is empty and unfocused.generated/jsx.ts:10091
propagateTextWidth?booleanWhether the widget should grow and shrink with the content.generated/jsx.ts:10093
ref?Ref<Gtk.Text>-generated/jsx.ts:10299
tabs?Pango.TabArray | nullCustom tabs for this text widget.generated/jsx.ts:10095
text?stringThe contents of the entry.generated/jsx.ts:10107
truncateMultiline?booleanWhen true, pasted multi-line text is truncated to the first line.generated/jsx.ts:10097
visibility?booleanIf false, the text is masked with the “invisible char”.generated/jsx.ts:10099
widthChars?numberNumber of characters to leave space for in the entry.generated/jsx.ts:10109
xalign?numberThe horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts.generated/jsx.ts:10115