Skip to main content

Type Alias: GtkTextProps

GtkTextProps = WidgetProps & object

Defined in: generated/jsx.ts:8107

Props for the GtkText widget.

Type Declaration

NameTypeDescriptionDefined in
activatesDefault?booleanWhether to activate the default widget when Enter is pressed.generated/jsx.ts:8109
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:8118
buffer?Gtk.EntryBufferThe GtkEntryBuffer object which stores the text.generated/jsx.ts:8120
children?ReactNode-generated/jsx.ts:8341
editable?booleanWhether the entry contents can be edited.generated/jsx.ts:8177
enableEmojiCompletion?booleanWhether to suggest Emoji replacements.generated/jsx.ts:8122
enableUndo?booleanIf undo/redo should be enabled for the editable.generated/jsx.ts:8179
extraMenu?Gio.MenuModel | nullA menu model whose contents will be appended to the context menu.generated/jsx.ts:8124
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:8134
inputHints?Gtk.InputHintsAdditional hints that allow input methods to fine-tune their behaviour.generated/jsx.ts:8139
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:8150
invisibleChar?numberThe character to used when masking contents (in “password mode”).generated/jsx.ts:8152
invisibleCharSet?booleanWhether the invisible char has been set.generated/jsx.ts:8154
maxLength?numberMaximum number of characters that are allowed. Zero indicates no limit.generated/jsx.ts:8160
maxWidthChars?numberThe desired maximum width of the entry, in characters.generated/jsx.ts:8181
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:8198
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:8207
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:8319
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:8217
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:8227
onDeleteFromCursor?(type, count, self) => 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:8241
onDeleteText?(startPos, endPos, self) => 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:8331
onInsertAtCursor?(string, self) => 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:8250
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:8260
onInsertText?(text, length, position, self) => 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:8340
onMoveCursor?(step, count, extend, self) => 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:8283
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:8292
onPreeditChanged?(preedit, self) => 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:8300
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:8308
overwriteMode?booleanIf text is overwritten when typing.generated/jsx.ts:8162
placeholderText?string | nullThe text that will be displayed in the GtkText when it is empty and unfocused.generated/jsx.ts:8167
propagateTextWidth?booleanWhether the widget should grow and shrink with the content.generated/jsx.ts:8169
ref?Ref<Gtk.Text>-generated/jsx.ts:8342
tabs?Pango.TabArray | nullCustom tabs for this text widget.generated/jsx.ts:8171
text?stringThe contents of the entry.generated/jsx.ts:8183
truncateMultiline?booleanWhen true, pasted multi-line text is truncated to the first line.generated/jsx.ts:8173
visibility?booleanIf false, the text is masked with the “invisible char”.generated/jsx.ts:8175
widthChars?numberNumber of characters to leave space for in the entry.generated/jsx.ts:8185
xalign?numberThe horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts.generated/jsx.ts:8191