SuperclassesDocumented Subclasses
None
Direct Slotsaccepts-tabThe accepts-tab property of type :boolean (Read / Write) Whether the Tab key will result in a tab character being entered. Default value: true bottom-marginThe bottom-margin property of type :int (Read / Write)
The 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. Do not confuse this property with the margin-bottom property. Allowed values: >= 0 Default value: 0 bufferThe buffer property of type gtk:text-buffer (Read / Write) The text buffer which is displayed. cursor-visibleThe cursor-visible property of type :boolean (Read / Write) Whether the insertion cursor is shown. Default value: true editableThe editable property of type :boolean (Read / Write) Whether the text can be modified by the user. Default value: true The extra-menu property of type g:menu-model (Read / Write) The menu model to append to the context menu.
im-moduleThe im-module property of type :string (Read / Write)
The IM (input method) module that should be used for the text view. See the gtk:im-context documentation. Setting this to a non- nil value
overrides the system-wide IM module setting. See the gtk-im-module setting. Default value: nil indentThe indent property of type :int (Read / Write) The amount to indent the paragraph, in pixels. Default value: 0 input-hintsThe input-hints property of type gtk:input-hints (Read / Write) The additional hints, beyond the input-purpose property, that allow input methods to fine-tune their behaviour. input-purposeThe input-purpose property of type gtk:input-purpose (Read / Write)
The purpose of the text view. This property can be used by on-screen keyboards and other input methods to adjust their behaviour. Default value: :free-form justificationThe justification property of type gtk:justification (Read / Write) The left, right, or center justification. Default value: :left left-marginThe left-margin property of type :int (Read / Write) The width of the left margin in pixels. Allowed values: >= 0 Default value: 0 monospaceThe monospace property of type :boolean (Read / Write) Whether to use a monospace font. Default value: false overwriteThe overwrite property of type :boolean (Read / Write) Whether entered text overwrites existing contents. Default value: false pixels-above-linesThe pixels-above-lines property of type :int (Read / Write) The pixels of blank space above paragraphs. Allowed values: >= 0 Default value: 0 pixels-below-linesThe pixels-below-lines property of type :int (Read / Write) The pixels of blank space below paragraphs. Allowed values: >= 0 Default value: 0 pixels-inside-wrapThe pixels-inside-wrap property of type :int (Read / Write) The pixels of blank space between wrapped lines in a paragraph. Allowed values: >= 0 Default value: 0 right-marginThe right-margin property of type :int (Read / Write) The width of the right margin in pixels. Allowed values: >= 0 Default value: 0 tabsThe tabs property of type pango:tab-array (Read / Write) The custom tabs for this text. top-marginThe top-margin property of type :int (Read / Write)
The 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. Do not confuse this property with the margin-top property. Allowed values: >= 0 Default value: 0 wrap-modeThe wrap-mode property of type gtk:wrap-mode (Read / Write)
Whether to wrap lines never, at word boundaries, or at character boundaries. Default value: :none Details
GTK has a powerful framework for multiline text editing.  Figure: GtkTextView The primary objects involved in the process are the gtk:text-buffer object, which represents the text being edited, and the gtk:text-view widget, a widget that can display a gtk:text-buffer object. Each text
buffer can be displayed by any number of views. CSS nodes
textview.view
├── border.top
├── border.left
├── text
│ ╰── [selection]
├── border.right
├── border.bottom
╰── [window.popup] The gtk:text-view implementation has a main CSS node with name textview and .view style class, and subnodes for each of the border windows, and the main text area, with names border and text, respectively. The border nodes each get one of the .left, .right, .top or .bottom style classes.
A node representing the selection will appear below the text node. If a
context menu is opened, the window node will appear as a subnode of the
main node. Accessibility The gtk:text-view implmementation uses the :text-box role of the gtk:accessible-role
enumeration. Signal Details
The "backspace" signal
lambda (view) :action
The signal is a keybinding signal which gets emitted when the user asks for it. The default bindings for this signal are the Backspace and Shift-Backspace keys.
The "copy-clipboard" signal
lambda (view) :action
The signal is a keybinding signal which gets emitted to copy the
selection to the clipboard. The default bindings for this signal are the Ctrl-c and Ctrl-Insert keys.
The "cut-clipboard" signal
lambda (view) :action
The signal is a keybinding signal which gets emitted to cut the selection
to the clipboard. The default bindings for this signal are the Ctrl-x and Shift-Delete keys.
The "delete-from-cursor" signal
lambda (view granularity count) :action - view
- The gtk:text-view widget that received the signal.
- granularity
- The granularity of the deletion as a value of the gtk:delete-type enumeration.
- count
- The integer for the number of type units to delete.
The signal is a keybinding signal which gets emitted when the user initiates a text deletion. If the granularity is :chars, GTK
deletes the selection if there is one, otherwise it deletes the requested
number of characters. The default bindings for this signal are the Delete key for deleting a character, the Ctrl-Delete key for deleting a word and the Ctrl-Backspace key for deleting a word
backwords.
The "extend-selection" signal
lambda (view granularity location start end) :run-last - view
- The gtk:text-view widget that received the signal.
- granularity
- The granularity as a value of the gtk:text-extend-selection enumeration.
- location
- The gtk:text-iter iterator where to extend the selection.
- start
- The gtk:text-iter iterator where the selection should start.
- end
- The gtk:text-iter iterator where the selection should end.
- Returns
- True to stop other handlers from being invoked for the event, false to propagate the event further.
The signal is emitted when the selection needs to be extended at the location iterator.
The "insert-at-cursor" signal
lambda (view text) :action - view
- The gtk:text-view widget that received the signal.
- text
- The string for the text to insert.
The signal is a keybinding signal which gets emitted when the user
initiates the insertion of text at the cursor. The signal has no default
bindings.
The "insert-emoji" signal
lambda (view) :action
This signal is a keybinding signal which gets emitted to present the Emoji
chooser for the text view. The default bindings for this signal are Ctrl-. and Ctrl-;.
The "move-cursor" signal
lambda (view step count extend) :action - view
- The gtk:text-view widget that received the signal.
- step
- The granularity of the move as a value of the gtk:movement-step enumeration.
- count
- The integer for the number of step units to move.
- extend
- True if the move should extend the selection.
The signal is a keybinding signal which gets emitted when the user
initiates a cursor movement. If the cursor is not visible in the text
view, this signal causes the viewport to be moved instead. Applications should not connect to it, but may emit it with the g:signal-emit
function 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 the Shift modifer does not. There are too many key combinations to list
them all here. Arrow keys move by individual characters/lines. The Ctrl-arrow key combinations move by words/paragraphs. The Home/ End keys move to the ends of the text buffer. The PageUp/ PageDown keys move vertically by pages. The Ctrl-PageUp/ PageDown keys move horizontally by pages.
The "move-viewport" signal
lambda (view step count) :action - view
- The gtk:text-view widget that received the signal.
- step
- The granularity of the move as a value of the gtk:movement-step enumeration.
- count
- The integer for the number of step units to move.
The signal is a keybinding signal which can be bound to key combinations
to allow the user to move the viewport, that is, to change what part of
the text view is visible in a scrolled window. There are no default
bindings for this signal.
The "paste-clipboard" signal
lambda (view) :action
The signal is a keybinding signal which gets emitted to paste the
contents of the clipboard into the text view. The default bindings for this signal are the Ctrl-v and Shift-Insert keys.
The "preedit-changed" signal
lambda (view preedit) :action - view
- The gtk:text-view object that received the signal.
- preedit
- The string for the current preedit text.
If an input method is used, the typed text will not immediately be
committed to the text buffer. So if you are interested in the text,
connect to this signal. The signal is only emitted if the text at the
given position is actually editable.
The "select-all" signal
lambda (view select) :action - view
- The gtk:text-view widget that received the signal.
- select
- True to select, false to unselect.
The signal is a keybinding signal which gets emitted to select or unselect
the complete contents of the text view. The default bindings for the signal are the Ctrl-a and Ctrl-/ keys for selecting and the Shift-Ctrl-a and Ctrl- keys for unselecting.
The "set-anchor" signal
lambda (view) :action
The 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. The signal has no default
bindings.
The "toggle-cursor-visible" signal
lambda (view) :action
This signal is a keybinding signal which gets emitted to toggle the visibility of the cursor. The default binding for this signal is F7.
The "toggle-overwrite" signal
lambda (view) :action
The signal is a keybinding signal which gets emitted to toggle the
overwrite mode of the text view. The default bindings for this signal is the Insert key. |
| Returned bySlot Access FunctionsInherited Slot Access FunctionsSee also |