Creates a new gtksource.view.View.
Connect to ChangeCase signal.
Connect to ChangeNumber signal.
Connect to JoinLines signal.
Connect to LineMarkActivated signal.
Connect to MoveLines signal.
Connect to MoveToMatchingBracket signal.
Connect to MoveWords signal.
Connect to ShowCompletion signal.
Connect to SmartHomeEnd signal.
Returns whether auto-indentation of text is enabled.
Returns the #GtkSourceBackgroundPatternType specifying if and how the background pattern should be displayed for this view.
Gets the classCompletion associated with view.
Gets the propertyView:enable-snippets property.
Returns the classGutter object associated with window_type for view.
Returns whether the current line is highlighted.
Gets the classHover associated with view.
Returns whether when the tab key is pressed the current selection should get indented instead of replaced with the \t character.
Returns the number of spaces to use for each step of indent.
Gets the propertyView:indenter property.
Returns whether when inserting a tabulator character it should be replaced by a group of space characters.
Gets attributes and priority for the category.
Gets the position of the right margin in the given view.
Returns whether line marks are displayed beside the text.
Returns whether line numbers are displayed beside the text.
Returns whether a right margin is displayed.
Returns true if pressing the Backspace key will try to delete spaces up to the previous tab stop.
Returns a enumSmartHomeEndType end value specifying how the cursor will move when HOME and END keys are pressed.
Gets the classSpaceDrawer associated with view.
Returns the width of tabulation in characters.
Determines the visual column at iter taking into consideration the propertyView:tab-width of view.
Inserts one indentation level at the beginning of the specified lines. The empty lines are not indented.
Inserts a new snippet at location
If true auto-indentation of text is enabled.
Set if and how the background pattern should be displayed.
Sets the propertyView:enable-snippets property.
If highlight is true the current line will be highlighted.
If true, when the tab key is pressed when several lines are selected, the selected lines are indented of one level instead of being replaced with a \t character. Shift+Tab unindents the selection.
Sets the number of spaces to use for each step of indent when the tab key is pressed.
Sets the indenter for view to indenter.
If true a tab key pressed is replaced by a group of space characters.
Sets attributes and priority for the category.
Sets the position of the right margin in the given view.
If true line marks will be displayed beside the text.
If true line numbers will be displayed beside the text.
If true a right margin is displayed.
When set to true, pressing the Backspace key will try to delete spaces up to the previous tab stop.
Set the desired movement of the cursor when HOME and END keys are pressed.
Sets the width of tabulation in characters.
Removes one indentation level at the beginning of the specified lines.
Creates a new #GtkSourceView widget displaying the buffer buffer.
Creates a new gtk.text_view.TextView widget displaying the buffer buffer.
Adds a child widget in the text buffer, at the given anchor.
Adds child at a fixed coordinate in the gtk.text_view.TextView's text window.
Moves the given iter backward by one display (wrapped) line.
Moves the given iter backward to the next display line start.
Converts buffer coordinates to window coordinates.
Moves the given iter forward by one display (wrapped) line.
Moves the given iter forward to the next display line end.
Returns whether pressing the <kbd>Tab</kbd> key inserts a tab characters.
Gets the bottom margin for text in the text_view.
Returns the gtk.text_buffer.TextBuffer being displayed by this text view.
Determine the positions of the strong and weak cursors if the insertion point is at iter.
Find out whether the cursor should be displayed.
Returns the default editability of the gtk.text_view.TextView.
Gets the menu model that gets added to the context menu or null if none has been set.
Gets a gtk.widget.Widget that has previously been set as gutter.
Gets the default indentation of paragraphs in text_view.
Gets the input-hints of the gtk.text_view.TextView.
Gets the input-purpose of the gtk.text_view.TextView.
Retrieves the iterator at buffer coordinates x and y.
Retrieves the iterator pointing to the character at buffer coordinates x and y.
Gets a rectangle which roughly contains the character at iter.
Gets the default justification of paragraphs in text_view.
Gets the default left margin size of paragraphs in the text_view.
Gets the gtk.text_iter.TextIter at the start of the line containing the coordinate y.
Gets the y coordinate of the top of the line containing iter, and the height of the line.
Gets the pango.context.Context that is used for rendering LTR directed text layouts.
Gets whether the gtk.text_view.TextView uses monospace styling.
Returns whether the gtk.text_view.TextView is in overwrite mode or not.
Gets the default number of pixels to put above paragraphs.
Gets the default number of pixels to put below paragraphs.
Gets the default number of pixels to put between wrapped lines inside a paragraph.
Gets the default right margin for text in text_view.
Gets the pango.context.Context that is used for rendering RTL directed text layouts.
Gets the default tabs for text_view.
Gets the top margin for text in the text_view.
Fills visible_rect with the currently-visible region of the buffer, in buffer coordinates.
Gets the line wrapping for the view.
Allow the gtk.text_view.TextView input method to internally handle key press and release events.
Moves a mark within the buffer so that it's located within the currently-visible text area.
Updates the position of a child.
Move the iterator a given number of characters visually, treating it as the strong cursor position.
Moves the cursor to the currently visible region of the buffer.
Removes a child widget from text_view.
Ensures that the cursor is shown.
Reset the input method context of the text view if needed.
Scrolls text_view the minimum distance such that mark is contained within the visible area of the widget.
Scrolls text_view so that iter is on the screen in the position indicated by xalign and yalign.
Scrolls text_view so that mark is on the screen in the position indicated by xalign and yalign.
Sets the behavior of the text widget when the <kbd>Tab</kbd> key is pressed.
Sets the bottom margin for text in text_view.
Sets buffer as the buffer being displayed by text_view.
Toggles whether the insertion point should be displayed.
Sets the default editability of the gtk.text_view.TextView.
Sets a menu model to add when constructing the context menu for text_view.
Places widget into the gutter specified by win.
Sets the default indentation for paragraphs in text_view.
Sets the input-hints of the gtk.text_view.TextView.
Sets the input-purpose of the gtk.text_view.TextView.
Sets the default justification of text in text_view.
Sets the default left margin for text in text_view.
Sets whether the gtk.text_view.TextView should display text in monospace styling.
Changes the gtk.text_view.TextView overwrite mode.
Sets the default number of blank pixels above paragraphs in text_view.
Sets the default number of pixels of blank space to put below paragraphs in text_view.
Sets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph.
Sets the default right margin for text in the text view.
Sets the default tab stops for paragraphs in text_view.
Sets the top margin for text in text_view.
Sets the line wrapping for the view.
Determines whether iter is at the start of a display line.
Converts coordinates on the window identified by win to buffer coordinates.
Connect to Backspace signal.
Connect to CopyClipboard signal.
Connect to CutClipboard signal.
Connect to DeleteFromCursor signal.
Connect to ExtendSelection signal.
Connect to InsertAtCursor signal.
Connect to InsertEmoji signal.
Connect to MoveCursor signal.
Connect to MoveViewport signal.
Connect to PasteClipboard signal.
Connect to PreeditChanged signal.
Connect to SelectAll signal.
Connect to SetAnchor signal.
Connect to ToggleCursorVisible signal.
Connect to ToggleOverwrite signal.
Subclass of gtk.text_view.TextView.
gtksource.view.View is the main class of the GtkSourceView library. Use a class@Buffer to display text with a gtksource.view.View.
This class provides:
An easy way to test all these features is to use the test-widget mini-program provided in the GtkSourceView repository, in the tests/ directory.
GtkSourceView as GtkBuildable
The GtkSourceView implementation of the gtk.buildable.Buildable interface exposes the property@View:completion object with the internal-child "completion".
An example of a UI definition fragment with GtkSourceView:
Changing the Font
Gtk CSS provides the best way to change the font for a gtksource.view.View in a manner that allows for components like class@Map to scale the desired font.
If you need to adjust the font or size of font within a portion of the document only, you should use a gtk.text_tag.TextTag with the gtk.text_tag.TextTag.utf8 or gtk.text_tag.TextTag.gdouble set so that the font size may be scaled relative to the default font set in CSS.