Sets our main struct and passes it to the parent class.
Creates a new gtk.TextView If you don’t call TextView.setBuffer before using the text view, an empty default buffer will be created for you. Get the buffer with TextView.getBuffer. If you want to specify your own buffer, consider TextView.newWithBuffer.
Creates a new gtk.TextView widget displaying the buffer buffer. One buffer can be shared among many widgets. buffer may be NULL to create a default buffer, in which case this function is equivalent to TextView.new. The text view adds its own reference count to the buffer; it does not take over an existing reference.
Adds a child widget in the text buffer, at the given anchor.
Adds a child at fixed coordinates in one of the text widget's windows.
The ::backspace signal is a [keybinding signal]GtkBindingSignal which gets emitted when the user asks for it.
The ::copy-clipboard signal is a [keybinding signal]GtkBindingSignal which gets emitted to copy the selection to the clipboard.
The ::cut-clipboard signal is a [keybinding signal]GtkBindingSignal which gets emitted to cut the selection to the clipboard.
The ::delete-from-cursor signal is a [keybinding signal]GtkBindingSignal which gets emitted when the user initiates a text deletion.
The ::extend-selection signal is emitted when the selection needs to be extended at location.
The ::insert-at-cursor signal is a [keybinding signal]GtkBindingSignal which gets emitted when the user initiates the insertion of a fixed string at the cursor.
The ::insert-emoji signal is a [keybinding signal]GtkBindingSignal which gets emitted to present the Emoji chooser for the text_view.
The ::move-cursor signal is a [keybinding signal]GtkBindingSignal which gets emitted when the user initiates a cursor movement. If the cursor is not visible in text_view, this signal causes the viewport to be moved instead.
The ::move-viewport signal is a [keybinding signal]GtkBindingSignal 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.
The ::paste-clipboard signal is a [keybinding signal]GtkBindingSignal which gets emitted to paste the contents of the clipboard into the text view.
The ::populate-popup signal gets emitted before showing the context menu of the text view.
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.
The ::select-all signal is a [keybinding signal]GtkBindingSignal which gets emitted to select or unselect the complete contents of the text view.
The ::set-anchor signal is a [keybinding signal]GtkBindingSignal 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 ::toggle-cursor-visible signal is a [keybinding signal]GtkBindingSignal which gets emitted to toggle the cursor-visible property.
The ::toggle-overwrite signal is a [keybinding signal]GtkBindingSignal which gets emitted to toggle the overwrite mode of the text view.
Simply appends some text to this view
Moves the given iter backward by one display (wrapped) line. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view’s width; paragraphs are the same in all views, since they depend on the contents of the gtk.TextBuffer
Moves the given iter backward to the next display line start. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view’s width; paragraphs are the same in all views, since they depend on the contents of the gtk.TextBuffer
Converts coordinate (buffer_x, buffer_y) to coordinates for the window win, and stores the result in (window_x, window_y).
Moves the given iter forward by one display (wrapped) line. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view’s width; paragraphs are the same in all views, since they depend on the contents of the gtk.TextBuffer
Moves the given iter forward to the next display line end. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view’s width; paragraphs are the same in all views, since they depend on the contents of the gtk.TextBuffer
Returns whether pressing the Tab key inserts a tab characters. TextView.setAcceptsTab.
Gets the width of the specified border window. See TextView.setBorderWindowSize.
Gets the bottom margin for text in the text_view.
Returns the gtk.TextBuffer being displayed by this text view. The reference count on the buffer is not incremented; the caller of this function won’t own a new reference.
Given an iter within a text layout, determine the positions of the strong and weak cursors if the insertion point is at that iterator. The position of each cursor is stored as a zero-width rectangle. The strong cursor location is the location where characters of the directionality equal to the base direction of the paragraph are inserted. The weak cursor location is the location where characters of the directionality opposite to the base direction of the paragraph are inserted.
Find out whether the cursor should be displayed.
Obtains a copy of the default text attributes. These are the attributes used for text unless a tag overrides them. You’d typically pass the default attributes in to TextIter.getAttributes in order to get the attributes in effect at a given text position.
Returns the default editability of the gtk.TextView Tags in the buffer may override this setting for some ranges of text.
Gets the default indentation of paragraphs in text_view. Tags in the view’s buffer may override the default. The indentation may be negative.
Gets the value of the input-hints property.
Gets the value of the input-purpose property.
Retrieves the iterator at buffer coordinates x and y. Buffer coordinates are coordinates for the entire buffer, not just the currently-displayed portion. If you have coordinates from an event, you have to convert those to buffer coordinates with TextView.windowToBufferCoords.
Retrieves the iterator pointing to the character at buffer coordinates x and y. Buffer coordinates are coordinates for the entire buffer, not just the currently-displayed portion. If you have coordinates from an event, you have to convert those to buffer coordinates with TextView.windowToBufferCoords.
Gets a rectangle which roughly contains the character at iter. The rectangle position is in buffer coordinates; use TextView.bufferToWindowCoords to convert these coordinates to coordinates for one of the windows in the text view.
Gets the default justification of paragraphs in text_view. Tags in the buffer may override the default.
Gets the default left margin size of paragraphs in the text_view. Tags in the buffer may override the default.
Gets the gtk.TextIter at the start of the line containing the coordinate y. y is in buffer coordinates, convert from window coordinates with TextView.windowToBufferCoords. If non-NULL, line_top will be filled with the coordinate of the top edge of the line.
Get the text line at the pixel y
Gets the y coordinate of the top of the line containing iter, and the height of the line. The coordinate is a buffer coordinate; convert to window coordinates with TextView.bufferToWindowCoords.
Gets the value of the monospace property.
Returns whether the gtk.TextView is in overwrite mode or not.
Gets the default number of pixels to put above paragraphs. Adding this function with TextView.getPixelsBelowLines is equal to the line space between each paragraph.
Gets the value set by TextView.setPixelsBelowLines.
Gets the value set by TextView.setPixelsInsideWrap.
Gets the default right margin for text in text_view. Tags in the buffer may override the default.
the main Gtk struct as a void*
Gets the default tabs for text_view. Tags in the buffer may override the defaults. The returned array will be NULL if “standard” (8-space) tabs are used. Free the return value with pango_tab_array_free().
Get the main Gtk struct
Gets the top margin for text in the text_view.
Fills visible_rect with the currently-visible region of the buffer, in buffer coordinates. Convert to window coordinates with TextView.bufferToWindowCoords.
Retrieves the gdk.Window corresponding to an area of the text view; possible windows include the overall widget window, child windows on the left, right, top, bottom, and the window that displays the text buffer. Windows are NULL and nonexistent if their width or height is 0, and are nonexistent before the widget has been realized.
Usually used to find out which window an event corresponds to.
Gets the line wrapping for the view.
Allow the gtk.TextView input method to internally handle key press and release events. If this function returns TRUE, then no further processing should be done for this key event. See gtk_im_context_filter_keypress().
Simply appends some on the cursor position
Updates the position of a child, as for TextView.addChildInWindow.
Moves a mark within the buffer so that it's located within the currently-visible text area.
Move the iterator a given number of characters visually, treating it as the strong cursor position. If count is positive, then the new strong cursor position will be count positions to the right of the old cursor position. If count is negative then the new strong cursor position will be count positions to the left of the old cursor position.
Moves the cursor to the currently visible region of the buffer, it it isn’t there already.
Ensures that the cursor is shown (i.e. not in an 'off' blink interval) and resets the time that it will stay blinking (or visible, in case blinking is disabled).
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. An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. If use_align is FALSE, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size within_margin.
Scrolls text_view so that mark is on the screen in the position indicated by xalign and yalign. An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. If use_align is FALSE, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size within_margin.
Sets the behavior of the text widget when the Tab key is pressed. If accepts_tab is TRUE, a tab character is inserted. If accepts_tab is FALSE the keyboard focus is moved to the next widget in the focus chain.
Sets the width of GTK_TEXT_WINDOW_LEFT or GTK_TEXT_WINDOW_RIGHT, or the height of GTK_TEXT_WINDOW_TOP or GTK_TEXT_WINDOW_BOTTOM. Automatically destroys the corresponding window if the size is set to 0, and creates the window if the size is set to non-zero. This function can only be used for the “border windows”, and it won’t work with GTK_TEXT_WINDOW_WIDGET, GTK_TEXT_WINDOW_TEXT, or GTK_TEXT_WINDOW_PRIVATE.
Sets the bottom margin for text in text_view.
Sets buffer as the buffer being displayed by text_view. The previous buffer displayed by the text view is unreferenced, and a reference is added to buffer. If you owned a reference to buffer before passing it to this function, you must remove that reference yourself; gtk.TextView will not “adopt” it.
Toggles whether the insertion point should be displayed. A buffer with no editable text probably shouldn’t have a visible cursor, so you may want to turn the cursor off.
Sets the default editability of the gtk.TextView You can override this default setting with tags in the buffer, using the “editable” attribute of tags.
Sets the default indentation for paragraphs in text_view. Tags in the buffer may override the default.
Sets the input-hints property, which allows input methods to fine-tune their behaviour.
Sets the input-purpose property which can be used by on-screen keyboards and other input methods to adjust their behaviour.
Sets the default justification of text in text_view. Tags in the view’s buffer may override the default.
Sets the default left margin for text in text_view. Tags in the buffer may override the default.
Sets the monospace property, which indicates that the text view should use monospace fonts.
Changes the gtk.TextView overwrite mode.
Sets the default number of blank pixels above paragraphs in text_view. Tags in the buffer for text_view may override the defaults.
Sets the default number of pixels of blank space to put below paragraphs in text_view. May be overridden by tags applied to text_view’s buffer.
Sets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph. May be overridden by tags in text_view’s buffer.
Sets the default right margin for text in the text view. Tags in the buffer may override the default.
Sets the default tab stops for paragraphs in text_view. Tags in the buffer may override the default.
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. See TextView.forwardDisplayLine for an explanation of display lines vs. paragraphs.
Converts coordinates on the window identified by win to buffer coordinates, storing the result in (buffer_x,buffer_y).
the main Gtk struct
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
Removes all widgets from the container
Adds widget to container. Typically used for simple containers such as gtk.Window, gtk.Frame, or gtk.Button; for more complicated layout containers such as gtk.Box or gtk.Grid, this function will pick default packing parameters that may not be correct. So consider functions such as Box.packStart and Grid.attach as an alternative to Container.add in those cases. A widget may be added to only one container at a time; you can’t place the same widget inside two different containers.
Gets the value of a child property for child and container.
Gets the values of one or more child properties for child and container.
Emits a child-notify signal for the [child property][child-properties] child_property on the child.
Emits a child-notify signal for the [child property][child-properties] specified by pspec on the child.
Sets a child property for child and container.
Sets one or more child properties for child and container.
Returns the type of the children supported by the container.
Invokes callback on each direct child of container, including children that are considered “internal” (implementation details of the container). “Internal” children generally weren’t added by the user of the container, but were added by the container implementation itself.
Invokes callback on each non-internal child of container. See Container.forall for details on what constitutes an “internal” child. For all practical purposes, this function should iterate over precisely those child widgets that were added to the container by the application with explicit add() calls.
Retrieves the border width of the container. See Container.setBorderWidth.
Returns the container’s non-internal children. See Container.forall for details on what constitutes an "internal" child.
Retrieves the focus chain of the container, if one has been set explicitly. If no focus chain has been explicitly set, GTK+ computes the focus chain based on the positions of the children. In that case, GTK+ stores NULL in focusable_widgets and returns FALSE.
Returns the current focus child widget inside container. This is not the currently focused widget. That can be obtained by calling Window.getFocus.
Retrieves the horizontal focus adjustment for the container. See gtk_container_set_focus_hadjustment ().
Retrieves the vertical focus adjustment for the container. See Container.setFocusVadjustment.
Returns a newly created widget path representing all the widget hierarchy from the toplevel down to and including child.
Returns the resize mode for the container. See gtk_container_set_resize_mode ().
When a container receives a call to the draw function, it must send synthetic draw calls to all children that don’t have their own gdk.Windows This function provides a convenient way of doing this. A container, when it receives a call to its draw function, calls Container.propagateDraw once for each child, passing in the cr the container received.
Removes widget from container. widget must be inside container. Note that container will own a reference to widget, and that this may be the last reference held; so removing a widget from its container can destroy that widget. If you want to use widget again, you need to add a reference to it before removing it from a container, using g_object_ref(). If you don’t want to use widget again it’s usually more efficient to simply destroy it directly using Widget.destroy since this will remove it from the container and help break any circular reference count cycles.
Sets the border width of the container.
Sets a focus chain, overriding the one computed automatically by GTK+.
Sets, or unsets if child is NULL, the focused child of container.
Hooks up an adjustment to focus handling in a container, so when a child of the container is focused, the adjustment is scrolled to show that widget. This function sets the horizontal alignment. See ScrolledWindow.getHadjustment for a typical way of obtaining the adjustment and Container.setFocusVadjustment for setting the vertical adjustment.
Hooks up an adjustment to focus handling in a container, so when a child of the container is focused, the adjustment is scrolled to show that widget. This function sets the vertical alignment. See ScrolledWindow.getVadjustment for a typical way of obtaining the adjustment and Container.setFocusHadjustment for setting the horizontal adjustment.
Sets the reallocate_redraws flag of the container to the given value.
Sets the resize mode for the container.
Removes a focus chain explicitly set with Container.setFocusChain.
Get the main Gtk struct
the main Gtk struct as a void*
Returns the size of a non-scrolling border around the outside of the scrollable. An example for this would be treeview headers. GTK+ can use this information to display overlayed graphics, like the overshoot indication, at the right position.
Retrieves the gtk.Adjustment used for horizontal scrolling.
Gets the horizontal GtkScrollablePolicy
Retrieves the gtk.Adjustment used for vertical scrolling.
Gets the vertical GtkScrollablePolicy
Sets the horizontal adjustment of the GtkScrollable
Sets the GtkScrollablePolicy to determine whether horizontal scrolling should start below the minimum width or below the natural width.
Sets the vertical adjustment of the GtkScrollable
Sets the GtkScrollablePolicy to determine whether vertical scrolling should start below the minimum height or below the natural height.
You may wish to begin by reading the [text widget conceptual overview]TextWidget which gives an overview of all the objects and data types related to the text widget and how they work together.
CSS nodes
|[<!-- language="plain" --> textview.view ├── border.top ├── border.left ├── text │ ╰── selection ├── border.right ├── border.bottom ╰── window.popup