Skip to main content

Type Alias: GtkTextViewProps

GtkTextViewProps = WidgetProps & object

Defined in: generated/jsx.ts:8345

Props for the GtkTextView widget.

Type Declaration

NameTypeDescriptionDefined in
acceptsTab?booleanWhether Tab will result in a tab character being entered.generated/jsx.ts:8347
bottomMargin?numberThe bottom margin for text in the text view. Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme. Don't confuse this property with Widget.margin-bottom.generated/jsx.ts:8357
children?ReactNode-generated/jsx.ts:8645
cursorVisible?booleanIf the insertion cursor is shown.generated/jsx.ts:8359
editable?booleanWhether the text can be modified by the user.generated/jsx.ts:8361
enableUndo?booleanWhether to enable undo/redogenerated/jsx.ts:8634
extraMenu?Gio.MenuModelA menu model whose contents will be appended to the context menu.generated/jsx.ts:8363
hadjustment?Gtk.AdjustmentHorizontal GtkAdjustment of the scrollable widget. This adjustment is shared between the scrollable widget and its parent.generated/jsx.ts:8449
hscrollPolicy?Gtk.ScrollablePolicyDetermines when horizontal scrolling should start.generated/jsx.ts:8451
imModule?stringWhich IM (input method) module should be used for this text_view. See IMMulticontext. Setting this to a non-%NULL value overrides the system-wide IM module setting. See the GtkSettings Settings.gtk-im-module property.generated/jsx.ts:8372
indent?numberAmount to indent the paragraph, in pixels. A negative value of indent will produce a hanging indentation. That is, the first line will have the full width, and subsequent lines will be indented by the absolute value of indent.generated/jsx.ts:8380
inputHints?Gtk.InputHintsAdditional hints (beyond TextView.input-purpose) that allow input methods to fine-tune their behaviour.generated/jsx.ts:8385
inputPurpose?Gtk.InputPurposeThe purpose of this text field. This property can be used by on-screen keyboards and other input methods to adjust their behaviour.generated/jsx.ts:8392
justification?Gtk.JustificationLeft, right, or center justification.generated/jsx.ts:8394
leftMargin?numberThe default left margin for text in the text view. Tags in the buffer may override the default. Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.generated/jsx.ts:8404
monospace?booleanWhether text should be displayed in a monospace font. If %TRUE, set the .monospace style class on the text view to indicate that a monospace font is desired.generated/jsx.ts:8411
onBackspace?(self) => void | nullGets emitted when the user asks for it. The ::backspace signal is a keybinding signal. The default bindings for this signal are Backspace and Shift+Backspace.generated/jsx.ts:8468
onBufferChanged?(buffer) => void | nullCallback when the buffer content changes. Use buffer.getText() to extract text.generated/jsx.ts:8636
onCanRedoChanged?(canRedo) => void | nullCallback when can-redo state changesgenerated/jsx.ts:8644
onCanUndoChanged?(canUndo) => void | nullCallback when can-undo state changesgenerated/jsx.ts:8642
onCopyClipboard?(self) => void | nullGets emitted to copy the selection to the clipboard. The ::copy-clipboard signal is a keybinding signal. The default bindings for this signal are Ctrl+c and Ctrl+Insert.generated/jsx.ts:8478
onCutClipboard?(self) => void | nullGets emitted to cut the selection to the clipboard. The ::cut-clipboard signal is a keybinding signal. The default bindings for this signal are Ctrl+x and Shift+Delete.generated/jsx.ts:8488
onDeleteFromCursor?(type, count, self) => void | nullGets emitted when the user initiates a text deletion. The ::delete-from-cursor signal is a keybinding signal. If the type is %GTK_DELETE_CHARS, GTK deletes the selection if there is one, otherwise it deletes the requested number of characters. The default bindings for this signal are Delete for deleting a character, Ctrl+Delete for deleting a word and Ctrl+Backspace for deleting a word backwards.generated/jsx.ts:8503
onExtendSelection?(granularity, location, start, end, self) => boolean | nullEmitted when the selection needs to be extended at location.generated/jsx.ts:8505
onInsertAtCursor?(string, self) => void | nullGets emitted when the user initiates the insertion of a fixed string at the cursor. The ::insert-at-cursor signal is a keybinding signal. This signal has no default bindings.generated/jsx.ts:8522
onInsertEmoji?(self) => void | nullGets emitted to present the Emoji chooser for the text_view. The ::insert-emoji signal is a keybinding signal. The default bindings for this signal are Ctrl+. and Ctrl+;generated/jsx.ts:8532
onMoveCursor?(step, count, extendSelection, self) => void | nullGets emitted when the user initiates a cursor movement. The ::move-cursor signal is a keybinding signal. If the cursor is not visible in text_view, this signal causes the viewport to be moved instead. 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 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 buffer - PgUp and PgDn move vertically by pages - Ctrl+PgUp and Ctrl+PgDn move horizontally by pagesgenerated/jsx.ts:8557
onMoveViewport?(step, count, self) => void | nullGets emitted to move the viewport. The ::move-viewport signal is a keybinding signal, which can be bound to key combinations to allow the user to move the viewport, i.e. change what part of the text view is visible in a containing scrolled window. There are no default bindings for this signal.generated/jsx.ts:8570
onPasteClipboard?(self) => void | nullGets emitted to paste the contents of the clipboard into the text view. The ::paste-clipboard signal is a keybinding signal. The default bindings for this signal are Ctrl+v and Shift+Insert.generated/jsx.ts:8581
onPreeditChanged?(preedit, self) => void | nullEmitted when preedit text of the active IM 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. This signal is only emitted if the text at the given position is actually editable.generated/jsx.ts:8592
onSelectAll?(select, self) => void | nullGets emitted to select or unselect the complete contents of the text view. The ::select-all signal is a keybinding signal. The default bindings for this signal are Ctrl+a and Ctrl+/ for selecting and Shift+Ctrl+a and Ctrl+`` for unselecting.generated/jsx.ts:8604
onSetAnchor?(self) => void | nullGets emitted when the user initiates settings the "anchor" mark. The ::set-anchor signal is a keybinding signal which gets emitted when the user initiates setting the "anchor" mark. The "anchor" mark gets placed at the same position as the "insert" mark. This signal has no default bindings.generated/jsx.ts:8615
onTextDeleted?(buffer, startOffset, endOffset) => void | nullCallback when text is deleted from the buffergenerated/jsx.ts:8640
onTextInserted?(buffer, offset, text) => void | nullCallback when text is inserted into the buffergenerated/jsx.ts:8638
onToggleCursorVisible?(self) => void | nullGets emitted to toggle the cursor-visible property. The ::toggle-cursor-visible signal is a keybinding signal. The default binding for this signal is F7.generated/jsx.ts:8624
onToggleOverwrite?(self) => void | nullGets emitted to toggle the overwrite mode of the text view. The ::toggle-overwrite signal is a keybinding signal. The default binding for this signal is Insert.generated/jsx.ts:8632
overwrite?booleanWhether entered text overwrites existing contents.generated/jsx.ts:8413
pixelsAboveLines?numberPixels of blank space above paragraphs.generated/jsx.ts:8415
pixelsBelowLines?numberPixels of blank space below paragraphs.generated/jsx.ts:8417
pixelsInsideWrap?numberPixels of blank space between wrapped lines in a paragraph.generated/jsx.ts:8419
ref?Ref<Gtk.TextView>-generated/jsx.ts:8646
rightMargin?numberThe default right margin for text in the text view. Tags in the buffer may override the default. Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.generated/jsx.ts:8429
tabs?Pango.TabArray | nullCustom tabs for this text.generated/jsx.ts:8431
topMargin?numberThe top margin for text in the text view. Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme. Don't confuse this property with Widget.margin-top.generated/jsx.ts:8441
vadjustment?Gtk.AdjustmentVertical GtkAdjustment of the scrollable widget. This adjustment is shared between the scrollable widget and its parent.generated/jsx.ts:8457
vscrollPolicy?Gtk.ScrollablePolicyDetermines when vertical scrolling should start.generated/jsx.ts:8459
wrapMode?Gtk.WrapModeWhether to wrap lines never, at word boundaries, or at character boundaries.generated/jsx.ts:8443