It derives from <GtkWidget>.
Displays the contents of a <GtkTextBuffer>.
You may wish to begin by reading the conceptual overview, which gives an overview of all the objects and data types related to the text widget and how they work together.
<GtkTextView> supports the following keyboard
shortcuts:
Additionally, the following signals have default keybindings:
text-view:backspace
text-view:copy-clipboard
text-view:cut-clipboard
text-view:delete-from-cursor
text-view:insert-emoji
text-view:move-cursor
text-view:paste-clipboard
text-view:select-all
text-view:toggle-cursor-visible
text-view:toggle-overwrite
<GtkTextView> defines a set of built-in actions:
clipboard.copy copies the contents to the clipboard.
clipboard.cut copies the contents to the clipboard and deletes it
from the widget.
clipboard.paste inserts the contents of the clipboard into the
widget.
menu.popup opens the context menu.
misc.insert-emoji opens the Emoji chooser.
selection.delete deletes the current selection.
selection.select-all selects all of the widgets content.
text.redo redoes the last change to the contents.
text.undo undoes the last change to the contents.
text.clear clears the content.
textview.view ├── border.top ├── border.left ├── text │ ╰── [selection] ├── border.right ├── border.bottom ╰── [window.popup]
<GtkTextView> has a main css node with name
textview and style class .view, 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 style classes .left,
.right, .top or .bottom.
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.
<GtkTextView> uses the
Gtk.AccessibleRole.text_box role.
parent-instanceWhether Tab will result in a tab character being entered.
Its value is a boolean.
Set it with (set! (text-view:accepts-tab self) value).
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.
Don’t confuse this property with widget:margin-bottom.
Its value is a 32-bit integer.
Set it with (set! (text-view:bottom-margin self) value).
The buffer which is displayed.
Its value is a <GtkTextBuffer>, or #f.
Set it with (set! (text-view:buffer self) value).
If the insertion cursor is shown.
Its value is a boolean.
Set it with (set! (text-view:cursor-visible self) value).
Whether the text can be modified by the user.
Its value is a boolean.
Set it with (set! (text-view:editable self) value).
A menu model whose contents will be appended to the context menu.
Its value is a <GMenuModel>, or #f.
Set it with (set! (text-view:extra-menu self) value).
Which IM (input method) module should be used for this text_view.
See <GtkIMMulticontext>.
Setting this to a non-#f value overrides the system-wide IM
module setting. See the GtkSettings settings:gtk-im-module property.
Its value is a string, or #f.
Set it with (set! (text-view:im-module self) value).
Amount 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.
Its value is a 32-bit integer.
Set it with (set! (text-view:indent self) value).
Additional hints (beyond text-view:input-purpose) that allow input methods to
fine-tune their behaviour.
Its value is a <GtkInputHints> (or, to set it,
a list of its symbols, or one of them).
Set it with (set! (text-view:input-hints self) value).
The purpose of this text field.
This property can be used by on-screen keyboards and other input methods to adjust their behaviour.
Its value is a <GtkInputPurpose> (or, to set
it, one of its symbols).
Set it with (set! (text-view:input-purpose self) value).
Left, right, or center justification.
Its value is a <GtkJustification> (or, to
set it, one of its symbols).
Set it with (set! (text-view:justification self) value).
The 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.
Its value is a 32-bit integer.
Set it with (set! (text-view:left-margin self) value).
Whether text should be displayed in a monospace font.
If #t, set the .monospace style class on the text view to
indicate that a monospace font is desired.
Its value is a boolean.
Set it with (set! (text-view:monospace self) value).
Whether entered text overwrites existing contents.
Its value is a boolean.
Set it with (set! (text-view:overwrite self) value).
Pixels of blank space above paragraphs.
Its value is a 32-bit integer.
Set it with (set! (text-view:pixels-above-lines self) value).
Pixels of blank space below paragraphs.
Its value is a 32-bit integer.
Set it with (set! (text-view:pixels-below-lines self) value).
Pixels of blank space between wrapped lines in a paragraph.
Its value is a 32-bit integer.
Set it with (set! (text-view:pixels-inside-wrap self) value).
The 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.
Its value is a 32-bit integer.
Set it with (set! (text-view:right-margin self) value).
Custom tabs for this text.
Its value is a <PangoTabArray>, or
#f.
Set it with (set! (text-view:tabs self) value).
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.
Don’t confuse this property with widget:margin-top.
Its value is a 32-bit integer.
Set it with (set! (text-view:top-margin self) value).
Whether to wrap lines never, at word boundaries, or at character boundaries.
Its value is a <GtkWrapMode> (or, to set it, one
of its symbols).
Set it with (set! (text-view:wrap-mode self) value).
Adds a child widget in the text buffer, at the given anchor.
Passed: a <GtkTextView>.
Passed: a <GtkWidget>.
Passed: a <GtkTextChildAnchor>.
a <GtkTextChildAnchor> in the
<GtkTextBuffer> for self
Adds child at a fixed coordinate in the
<GtkTextView>’s text window.
The xpos and ypos must be in buffer coordinates (see
text-view:get-iter-location! to
convert to buffer coordinates).
child will scroll with the text view.
If instead you want a widget that will not move with the
<GtkTextView> contents see
<GtkOverlay>.
Passed: a <GtkTextView>.
Passed: a <GtkWidget>.
Passed: a 32-bit integer.
X position of child in window coordinates
Passed: a 32-bit integer.
Y position of child in window coordinates
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 <GtkTextBuffer>.
Passed: a <GtkTextView>.
Passed: a <GtkTextIter>.
Returned: a boolean.
#t if iter was moved and is not on the end iterator
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 <GtkTextBuffer>.
Passed: a <GtkTextView>.
Passed: a <GtkTextIter>.
Returned: a boolean.
#t if iter was moved and is not on the end iterator
Converts buffer coordinates to window coordinates.
Passed: a <GtkTextView>.
Passed: a <GtkTextWindowType>, or one of
its symbols.
Passed: a 32-bit integer.
buffer x coordinate
Passed: a 32-bit integer.
buffer y coordinate
Returned: a 32-bit integer.
window x coordinate return location
Returned: a 32-bit integer.
window y coordinate return location
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 <GtkTextBuffer>.
Passed: a <GtkTextView>.
Passed: a <GtkTextIter>.
Returned: a boolean.
#t if iter was moved and is not on the end iterator
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 <GtkTextBuffer>.
Passed: a <GtkTextView>.
Passed: a <GtkTextIter>.
Returned: a boolean.
#t if iter was moved and is not on the end iterator
Returns whether pressing the Tab key inserts a tab characters.
See text-view:set-accepts-tab.
Passed: a <GtkTextView>.
Returned: a boolean.
#t if pressing the Tab key inserts a tab character, #f if
pressing the Tab key moves the keyboard focus.
Gets the bottom margin for text in the self.
Passed: a <GtkTextView>.
Returned: a 32-bit integer.
bottom margin in pixels
Returns the <GtkTextBuffer> 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.
Passed: a <GtkTextView>.
Returned: a <GtkTextBuffer>.
Determine the positions of the strong and weak cursors if the insertion point is at iter.
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.
If iter is #f, the actual cursor position is used.
Note that if iter happens to be the actual cursor position, and there is currently an IM preedit sequence being entered, the returned locations will be adjusted to account for the preedit cursor’s offset within the preedit sequence.
The rectangle position is in buffer coordinates; use text-view:buffer-to-window-coords to convert
these coordinates to coordinates for one of the windows in the text
view.
Passed: a <GtkTextView>.
Passed: a <GtkTextIter>, or #f.
Passed, filled in, and returned: a
<GdkRectangle>.
location to store the strong cursor position
Passed, filled in, and returned: a
<GdkRectangle>.
location to store the weak cursor position
Find out whether the cursor should be displayed.
Passed: a <GtkTextView>.
Returned: a boolean.
whether the insertion mark is visible
Returns the default editability of the
<GtkTextView>.
Tags in the buffer may override this setting for some ranges of text.
Passed: a <GtkTextView>.
Returned: a boolean.
whether text is editable by default
Gets the menu model that gets added to the context menu or #f if
none has been set.
Passed: a <GtkTextView>.
Returned: a <GMenuModel>, or #f.
the menu model
Gets a <GtkWidget> that has previously been set as
gutter.
See text-view:set-gutter.
win must be one of left,
right, top, or
bottom.
Passed: a <GtkTextView>.
Passed: a <GtkTextWindowType>, or one of
its symbols.
Returned: a <GtkWidget>, or #f.
Gets the default indentation of paragraphs in self.
Tags in the view’s buffer may override the default. The indentation may be negative.
Passed: a <GtkTextView>.
Returned: a 32-bit integer.
number of pixels of indentation
Gets the input-hints of the <GtkTextView>.
Passed: a <GtkTextView>.
Returned: a <GtkInputHints>.
the input hints
Gets the input-purpose of the
<GtkTextView>.
Passed: a <GtkTextView>.
Returned: a <GtkInputPurpose>.
the input purpose
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 text-view:window-to-buffer-coords.
Passed: a <GtkTextView>.
Passed, filled in, and returned: a <GtkTextIter>.
Passed: a 32-bit integer.
x position, in buffer coordinates
Passed: a 32-bit integer.
y position, in buffer coordinates
Returned: a boolean.
#t if the position is over text
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 text-view:window-to-buffer-coords.
Note that this is different from text-view:get-iter-at-location!, which returns
cursor locations, i.e. positions between characters.
Passed: a <GtkTextView>.
Passed, filled in, and returned: a <GtkTextIter>.
Passed: a 32-bit integer.
x position, in buffer coordinates
Passed: a 32-bit integer.
y position, in buffer coordinates
Returned: a boolean.
#t if the position is over text
Returned: a 32-bit integer.
if non-#f, location to store an integer indicating where in the
grapheme the user clicked. It will either be zero, or the number of
characters in the grapheme. 0 represents the trailing edge of the
grapheme.
Gets a rectangle which roughly contains the character at iter.
The rectangle position is in buffer coordinates; use text-view:buffer-to-window-coords to convert
these coordinates to coordinates for one of the windows in the text
view.
Passed: a <GtkTextView>.
Passed: a <GtkTextIter>.
Passed, filled in, and returned: a
<GdkRectangle>.
bounds of the character at iter
Gets the default justification of paragraphs in self.
Tags in the buffer may override the default.
Passed: a <GtkTextView>.
Returned: a <GtkJustification>.
default justification
Gets the default left margin size of paragraphs in the self.
Tags in the buffer may override the default.
Passed: a <GtkTextView>.
Returned: a 32-bit integer.
left margin in pixels
Gets the <GtkTextIter> at the start of the line
containing the coordinate y.
y is in buffer coordinates, convert from window coordinates with
text-view:window-to-buffer-coords. If
non-#f, line-top will be filled with the coordinate of the
top edge of the line.
Passed: a <GtkTextView>.
Passed, filled in, and returned: a <GtkTextIter>.
Passed: a 32-bit integer.
a y coordinate
Returned: a 32-bit integer.
return location for top coordinate of the line
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 text-view:buffer-to-window-coords.
Passed: a <GtkTextView>.
Passed: a <GtkTextIter>.
Returned: a 32-bit integer.
return location for a y coordinate
Returned: a 32-bit integer.
return location for a height
Gets the <PangoContext> that is used for
rendering LTR directed text layouts.
The context may be replaced when CSS changes occur.
Passed: a <GtkTextView>.
Returned: a <PangoContext>.
Gets whether the <GtkTextView> uses monospace
styling.
Passed: a <GtkTextView>.
Returned: a boolean.
#t if monospace fonts are desired
Returns whether the <GtkTextView> is in overwrite
mode or not.
Passed: a <GtkTextView>.
Returned: a boolean.
whether self is in overwrite mode or not.
Gets the default number of pixels to put above paragraphs.
Adding this function with text-view:get-pixels-below-lines is equal to
the line space between each paragraph.
Passed: a <GtkTextView>.
Returned: a 32-bit integer.
default number of pixels above paragraphs
Gets the default number of pixels to put below paragraphs.
The line space is the sum of the value returned by this function and the
value returned by text-view:get-pixels-above-lines.
Passed: a <GtkTextView>.
Returned: a 32-bit integer.
default number of blank pixels below paragraphs
Gets the default number of pixels to put between wrapped lines inside a paragraph.
Passed: a <GtkTextView>.
Returned: a 32-bit integer.
default number of pixels of blank space between wrapped lines
Gets the default right margin for text in self.
Tags in the buffer may override the default.
Passed: a <GtkTextView>.
Returned: a 32-bit integer.
right margin in pixels
Gets the <PangoContext> that is used for
rendering RTL directed text layouts.
The context may be replaced when CSS changes occur.
Passed: a <GtkTextView>.
Returned: a <PangoContext>.
Gets the default tabs for self.
Tags in the buffer may override the defaults. The returned array will
be #f if “standard” (8-space) tabs are used. Free the return
value with tab-array:free.
Passed: a <GtkTextView>.
Returned: a <PangoTabArray>, or #f.
copy of default tab array, or #f if standard tabs are used; must
be freed with tab-array:free.
Gets the top margin for text in the self.
Passed: a <GtkTextView>.
Returned: a 32-bit integer.
top margin in pixels
Gets the X,Y offset in buffer coordinates of the top-left corner of the textview’s text contents.
This allows for more-precise positioning than what is provided by
text-view:get-visible-rect! as
you can discover what device pixel is being quantized for text
positioning.
You might want this when making ulterior widgets align with quantized device pixels of the textview contents such as line numbers.
Passed: a <GtkTextView>.
Returned: a real number.
a location for the X offset
Returned: a real number.
a location for the Y offset
Fills visible-rect with the currently-visible region of the buffer, in buffer coordinates.
Convert to window coordinates with text-view:buffer-to-window-coords.
Passed: a <GtkTextView>.
Passed, filled in, and returned: a
<GdkRectangle>.
rectangle to fill
Gets the line wrapping for the view.
Passed: a <GtkTextView>.
Returned: a <GtkWrapMode>.
the line wrap setting
Allow the <GtkTextView> input method to
internally handle key press and release events.
If this function returns #t, then no further processing should be
done for this key event. See imcontext:filter-keypress?.
Note that you are expected to call this function from your handler when
overriding key event handling. This is needed in the case when you need
to insert your own key handling between the input method and the default
key event handling of the <GtkTextView>.
static gboolean
gtk_foo_bar_key_press_event (GtkWidget *widget,
GdkEvent *event)
{
guint keyval;
gdk_event_get_keyval ((GdkEvent*)event, &keyval);
if (keyval == GDK_KEY_Return || keyval == GDK_KEY_KP_Enter)
{
if (gtk_text_view_im_context_filter_keypress (GTK_TEXT_VIEW (widget), event))
return TRUE;
}
// Do some stuff
return GTK_WIDGET_CLASS (gtk_foo_bar_parent_class)->key_press_event (widget, event);
}
Passed: a <GtkTextView>.
Passed: a <GdkEvent>.
the key event
Returned: a boolean.
#t if the input method handled the key event.
Moves a mark within the buffer so that it’s located within the currently-visible text area.
Passed: a <GtkTextView>.
Passed: a <GtkTextMark>.
Returned: a boolean.
#t if the mark moved (wasn’t already onscreen)
Updates the position of a child.
Passed: a <GtkTextView>.
Passed: a <GtkWidget>.
a widget already added with text-view:add-overlay
Passed: a 32-bit integer.
new X position in buffer coordinates
Passed: a 32-bit integer.
new Y position in buffer coordinates
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.
In the presence of bi-directional text, the correspondence between logical and visual order will depend on the direction of the current run, and there may be jumps when the cursor is moved off of the end of a run.
Passed: a <GtkTextView>.
Passed: a <GtkTextIter>.
Passed: a 32-bit integer.
number of characters to move (negative moves left, positive moves right)
Returned: a boolean.
#t if iter moved and is not on the end iterator
Creates a new <GtkTextView>.
If you don’t call text-view:set-buffer
before using the text view, an empty default buffer will be created for
you. Get the buffer with text-view:get-buffer. If you want to specify your own
buffer, consider text-view:new-with-buffer.
Returned: a <GtkWidget>.
a new <GtkTextView>
Creates a new <GtkTextView> widget displaying the
buffer buffer.
One buffer can be shared among many widgets. buffer may be
#f to create a default buffer, in which case this function is
equivalent to text-view:new. The text view
adds its own reference count to the buffer; it does not take over an
existing reference.
Passed: a <GtkTextBuffer>.
Returned: a <GtkWidget>.
a new <GtkTextView>.
Moves the cursor to the currently visible region of the buffer.
Passed: a <GtkTextView>.
Returned: a boolean.
#t if the cursor had to be moved.
Removes a child widget from self.
Passed: a <GtkTextView>.
Passed: a <GtkWidget>.
the child to remove
Ensures that the cursor is shown.
This also resets the time that it will stay blinking (or visible, in case blinking is disabled).
This function should be called in response to user input (e.g. from derived classes that override the textview’s event handlers).
Passed: a <GtkTextView>.
Reset the input method context of the text view if needed.
This can be necessary in the case where modifying the buffer would confuse on-going input method behavior.
Passed: a <GtkTextView>.
Scrolls self the minimum distance such that mark is contained within the visible area of the widget.
Passed: a <GtkTextView>.
Passed: a <GtkTextMark>.
a mark in the buffer for self
Scrolls self 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 #f, 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.
Note that this function uses the currently-computed height of the lines
in the text buffer. Line heights are computed in an idle handler; so
this function may not have the desired effect if it’s called before the
height computations. To avoid oddness, consider using
text-view:scroll-to-mark which
saves a point to be scrolled to after line validation.
Passed: a <GtkTextView>.
Passed: a <GtkTextIter>.
Passed: a real number.
margin as a [0.0,0.5) fraction of screen size
Passed: a boolean.
whether to use alignment arguments (if #f, just get the mark
onscreen)
Passed: a real number.
horizontal alignment of mark within visible area
Passed: a real number.
vertical alignment of mark within visible area
Returned: a boolean.
#t if scrolling occurred
Scrolls self 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 #f, 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.
Passed: a <GtkTextView>.
Passed: a <GtkTextMark>.
Passed: a real number.
margin as a [0.0,0.5) fraction of screen size
Passed: a boolean.
whether to use alignment arguments (if #f, just get the mark
onscreen)
Passed: a real number.
horizontal alignment of mark within visible area
Passed: a real number.
vertical alignment of mark within visible area
Sets the behavior of the text widget when the Tab key is pressed.
If accepts-tab is #t, a tab character is inserted. If
accepts-tab is #f the keyboard focus is moved to the next
widget in the focus chain.
Focus can always be moved using Ctrl+Tab.
Passed: a <GtkTextView>.
Passed: a boolean.
#t if pressing the Tab key should insert a tab character,
#f, if pressing the Tab key should move the keyboard focus.
Sets the bottom margin for text in self.
Note that this function is confusingly named. In CSS terms, the value set here is padding.
Passed: a <GtkTextView>.
Passed: a 32-bit integer.
bottom margin in pixels
Sets buffer as the buffer being displayed by self.
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; <GtkTextView> will not
“adopt” it.
Passed: a <GtkTextView>.
Passed, or left out: a <GtkTextBuffer>, or
#f.
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.
Note that this property may be overridden by the settings:gtk-keynav-use-caret setting.
Passed: a <GtkTextView>.
Passed: a boolean.
whether to show the insertion cursor
Sets the default editability of the
<GtkTextView>.
You can override this default setting with tags in the buffer, using the “editable” attribute of tags.
Passed: a <GtkTextView>.
Passed: a boolean.
whether it’s editable
Sets a menu model to add when constructing the context menu for self.
You can pass #f to remove a previously set extra menu.
Passed: a <GtkTextView>.
Passed, or left out: a <GMenuModel>, or
#f.
Places widget into the gutter specified by win.
win must be one of left,
right, top, or
bottom.
Passed: a <GtkTextView>.
Passed: a <GtkTextWindowType>, or one of
its symbols.
Passed, or left out: a <GtkWidget>, or #f.
Sets the default indentation for paragraphs in self.
Tags in the buffer may override the default.
Passed: a <GtkTextView>.
Passed: a 32-bit integer.
indentation in pixels
Sets the input-hints of the <GtkTextView>.
The input-hints allow input methods to fine-tune their behaviour.
Passed: a <GtkTextView>.
Passed: a <GtkInputHints>, or a list of its
symbols, or one of them.
the hints
Sets the input-purpose of the
<GtkTextView>.
The input-purpose can be used by on-screen keyboards and other
input methods to adjust their behaviour.
Passed: a <GtkTextView>.
Passed: a <GtkInputPurpose>, or one of its
symbols.
the purpose
Sets the default justification of text in self.
Tags in the view’s buffer may override the default.
Passed: a <GtkTextView>.
Passed: a <GtkJustification>, or one of its
symbols.
justification
Sets the default left margin for text in self.
Tags in the buffer may override the default.
Note that this function is confusingly named. In CSS terms, the value set here is padding.
Passed: a <GtkTextView>.
Passed: a 32-bit integer.
left margin in pixels
Sets whether the <GtkTextView> should display
text in monospace styling.
Passed: a <GtkTextView>.
Passed: a boolean.
#t to request monospace styling
Changes the <GtkTextView> overwrite mode.
Passed: a <GtkTextView>.
Passed: a boolean.
#t to turn on overwrite mode, #f to turn it off
Sets the default number of blank pixels above paragraphs in self.
Tags in the buffer for self may override the defaults.
Passed: a <GtkTextView>.
Passed: a 32-bit integer.
pixels above paragraphs
Sets the default number of pixels of blank space to put below paragraphs in self.
May be overridden by tags applied to self’s buffer.
Passed: a <GtkTextView>.
Passed: a 32-bit integer.
pixels below paragraphs
Sets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph.
May be overridden by tags in self’s buffer.
Passed: a <GtkTextView>.
Passed: a 32-bit integer.
default number of pixels between wrapped lines
Sets the default right margin for text in the text view.
Tags in the buffer may override the default.
Note that this function is confusingly named. In CSS terms, the value set here is padding.
Passed: a <GtkTextView>.
Passed: a 32-bit integer.
right margin in pixels
Sets the default tab stops for paragraphs in self.
Tags in the buffer may override the default.
Passed: a <GtkTextView>.
Passed: a <PangoTabArray>.
tabs as a <PangoTabArray>
Sets the top margin for text in self.
Note that this function is confusingly named. In CSS terms, the value set here is padding.
Passed: a <GtkTextView>.
Passed: a 32-bit integer.
top margin in pixels
Sets the line wrapping for the view.
Passed: a <GtkTextView>.
Passed: a <GtkWrapMode>, or one of its symbols.
Determines whether iter is at the start of a display line.
See text-view:forward-display-line? for an
explanation of display lines vs. paragraphs.
Passed: a <GtkTextView>.
Passed: a <GtkTextIter>.
Returned: a boolean.
#t if iter begins a wrapped line
Converts coordinates on the window identified by win to buffer coordinates.
Passed: a <GtkTextView>.
Passed: a <GtkTextWindowType>, or one of
its symbols.
Passed: a 32-bit integer.
window x coordinate
Passed: a 32-bit integer.
window y coordinate
Returned: a 32-bit integer.
buffer x coordinate return location
Returned: a 32-bit integer.
buffer y coordinate return location
Connect a handler with (connect object text-view:backspace
handler). It is called as (handler self).
Gets 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.
Passed: a <GtkTextView>.
Connect a handler with (connect object text-view:copy-clipboard
handler). It is called as (handler self).
Gets 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.
Passed: a <GtkTextView>.
Connect a handler with (connect object text-view:cut-clipboard
handler). It is called as (handler self).
Gets 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.
Passed: a <GtkTextView>.
Connect a handler with (connect object
text-view:delete-from-cursor handler). It is called as (handler
self type count).
Gets emitted when the user initiates a text deletion.
The ::delete-from-cursor signal is a keybinding signal.
If the type 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 Delete for deleting a character, Ctrl+Delete for deleting a word and Ctrl+Backspace for deleting a word backwards.
Passed: a <GtkTextView>.
Passed: a <GtkDeleteType>.
the granularity of the deletion, as a
<GtkDeleteType>
Passed: a 32-bit integer.
the number of type units to delete
Connect a handler with (connect object text-view:extend-selection
handler). It is called as (handler self granularity location
start end) ⇒ %return.
Emitted when the selection needs to be extended at location.
Passed: a <GtkTextView>.
Passed: a <GtkTextExtendSelection>.
the granularity type
Passed: a <GtkTextIter>.
the location where to extend the selection
Passed: a <GtkTextIter>.
where the selection should start
Passed: a <GtkTextIter>.
where the selection should end
Returned: a boolean.
GDK_EVENT_STOP to stop other handlers from being invoked for the
event. GDK_EVENT_PROPAGATE to propagate the event further.
Connect a handler with (connect object text-view:insert-at-cursor
handler). It is called as (handler self string).
Gets 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.
Passed: a <GtkTextView>.
Passed: a string.
the string to insert
Connect a handler with (connect object text-view:insert-emoji
handler). It is called as (handler self).
Gets 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+;
Passed: a <GtkTextView>.
Connect a handler with (connect object text-view:move-cursor
handler). It is called as (handler self step count
extend-selection).
Gets 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.
Passed: a <GtkTextView>.
Passed: a <GtkMovementStep>.
the granularity of the move, as a
<GtkMovementStep>
Passed: a 32-bit integer.
the number of step units to move
Passed: a boolean.
#t if the move should extend the selection
Connect a handler with (connect object text-view:move-viewport
handler). It is called as (handler self step count).
Gets 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.
Passed: a <GtkTextView>.
Passed: a <GtkScrollStep>.
the granularity of the movement, as a
<GtkScrollStep>
Passed: a 32-bit integer.
the number of step units to move
Connect a handler with (connect object text-view:paste-clipboard
handler). It is called as (handler self).
Gets 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.
Passed: a <GtkTextView>.
Connect a handler with (connect object text-view:preedit-changed
handler). It is called as (handler self preedit).
Emitted 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.
Passed: a <GtkTextView>.
Passed: a string.
the current preedit string
Connect a handler with (connect object text-view:select-all
handler). It is called as (handler self select).
Gets 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.
Passed: a <GtkTextView>.
Passed: a boolean.
#t to select, #f to unselect
Connect a handler with (connect object text-view:set-anchor
handler). It is called as (handler self).
Gets 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.
Passed: a <GtkTextView>.
Connect a handler with (connect object
text-view:toggle-cursor-visible handler). It is called as
(handler self).
Gets emitted to toggle the cursor-visible property.
The ::toggle-cursor-visible signal is a keybinding signal.
The default binding for this signal is F7.
Passed: a <GtkTextView>.
Connect a handler with (connect object text-view:toggle-overwrite
handler). It is called as (handler self).
Gets 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.
Passed: a <GtkTextView>.
The class handler for the text-view:backspace keybinding signal.
To override it in a new class, give register-type #:vfuncs
`((backspace . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<GtkTextView>, or a class that derives from it,
or its GType number.
Passed: a <GtkTextView>.
The class handler for the text-view:copy-clipboard keybinding signal.
To override it in a new class, give register-type #:vfuncs
`((copy-clipboard . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<GtkTextView>, or a class that derives from it,
or its GType number.
Passed: a <GtkTextView>.
The class handler for the text-view:cut-clipboard keybinding signal
To override it in a new class, give register-type #:vfuncs
`((cut-clipboard . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<GtkTextView>, or a class that derives from it,
or its GType number.
Passed: a <GtkTextView>.
The class handler for the text-view:delete-from-cursor keybinding signal.
To override it in a new class, give register-type #:vfuncs
`((delete-from-cursor . ,procedure)). The procedure is called as
(procedure self type count).
Passed: the class whose implementation to call:
<GtkTextView>, or a class that derives from it,
or its GType number.
Passed: a <GtkTextView>.
Passed: a <GtkDeleteType>, or one of its
symbols.
Passed: a 32-bit integer.
The class handler for the text-view:extend-selection signal.
To override it in a new class, give register-type #:vfuncs
`((extend-selection . ,procedure)). The procedure is called as
(procedure self granularity location start end) ⇒ %return.
Passed: the class whose implementation to call:
<GtkTextView>, or a class that derives from it,
or its GType number.
Passed: a <GtkTextView>.
Passed: a <GtkTextExtendSelection>, or
one of its symbols.
Passed: a <GtkTextIter>.
Passed: a <GtkTextIter>.
Passed: a <GtkTextIter>.
Returned: a boolean.
The class handler for the text-view:insert-at-cursor keybinding signal.
To override it in a new class, give register-type #:vfuncs
`((insert-at-cursor . ,procedure)). The procedure is called as
(procedure self str).
Passed: the class whose implementation to call:
<GtkTextView>, or a class that derives from it,
or its GType number.
Passed: a <GtkTextView>.
Passed: a string.
The class handler for the text-view:insert-emoji signal.
To override it in a new class, give register-type #:vfuncs
`((insert-emoji . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<GtkTextView>, or a class that derives from it,
or its GType number.
Passed: a <GtkTextView>.
The class handler for the text-view:move-cursor keybinding signal.
To override it in a new class, give register-type #:vfuncs
`((move-cursor . ,procedure)). The procedure is called as
(procedure self step count extend-selection).
Passed: the class whose implementation to call:
<GtkTextView>, or a class that derives from it,
or its GType number.
Passed: a <GtkTextView>.
Passed: a <GtkMovementStep>, or one of its
symbols.
Passed: a 32-bit integer.
Passed: a boolean.
The class handler for the text-view:paste-clipboard keybinding signal.
To override it in a new class, give register-type #:vfuncs
`((paste-clipboard . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<GtkTextView>, or a class that derives from it,
or its GType number.
Passed: a <GtkTextView>.
The class handler for the text-view:set-anchor keybinding signal.
To override it in a new class, give register-type #:vfuncs
`((set-anchor . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<GtkTextView>, or a class that derives from it,
or its GType number.
Passed: a <GtkTextView>.
The snapshot_layer vfunc is called before and after the text view is
drawing its own text. Applications can override this vfunc in a
subclass to draw customized content underneath or above the text. In
the below-text and
above-text layers the drawing is done in the
buffer coordinate space.
To override it in a new class, give register-type #:vfuncs
`((snapshot-layer . ,procedure)). The procedure is called as
(procedure self layer snapshot).
Passed: the class whose implementation to call:
<GtkTextView>, or a class that derives from it,
or its GType number.
Passed: a <GtkTextView>.
Passed: a <GtkTextViewLayer>, or one of its
symbols.
Passed: a <GtkSnapshot>.
The class handler for the text-view:toggle-overwrite keybinding signal.
To override it in a new class, give register-type #:vfuncs
`((toggle-overwrite . ,procedure)). The procedure is called as
(procedure self).
Passed: the class whose implementation to call:
<GtkTextView>, or a class that derives from it,
or its GType number.
Passed: a <GtkTextView>.