Class
GtkTextView
Description [src]
class Gtk.TextView : Gtk.Container
implements Atk.ImplementorIface, Gtk.Buildable, Gtk.Scrollable {
/* No available fields */
}
You may wish to begin by reading the text widget conceptual overview which gives an overview of all the objects and data types related to the text widget and how they work together.
CSS nodes
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.
Constructors
gtk_text_view_new
Creates a new GtkTextView
. If you don’t call gtk_text_view_set_buffer()
before using the text view, an empty default buffer will be created
for you. Get the buffer with gtk_text_view_get_buffer(). If you want
to specify your own buffer, consider gtk_text_view_new_with_buffer().
gtk_text_view_new_with_buffer
Creates a new GtkTextView
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 gtk_text_view_new(). The
text view adds its own reference count to the buffer; it does not
take over an existing reference.
Instance methods
gtk_text_view_add_child_in_window
Adds a child at fixed coordinates in one of the text widget’s windows.
gtk_text_view_backward_display_line
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
.
gtk_text_view_backward_display_line_start
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
.
gtk_text_view_buffer_to_window_coords
Converts coordinate (buffer_x
, buffer_y
) to coordinates for the window
win
, and stores the result in (window_x
, window_y
).
gtk_text_view_forward_display_line
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
.
gtk_text_view_forward_display_line_end
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
.
gtk_text_view_get_accepts_tab
Returns whether pressing the Tab key inserts a tab characters. gtk_text_view_set_accepts_tab().
since: 2.4
gtk_text_view_get_border_window_size
Gets the width of the specified border window. See gtk_text_view_set_border_window_size().
gtk_text_view_get_buffer
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.
gtk_text_view_get_cursor_locations
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.
since: 3.0
gtk_text_view_get_default_attributes
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
gtk_text_iter_get_attributes()
in order to get the
attributes in effect at a given text position.
gtk_text_view_get_editable
Returns the default editability of the GtkTextView
. Tags in the
buffer may override this setting for some ranges of text.
gtk_text_view_get_hadjustment
Gets the horizontal-scrolling GtkAdjustment
.
deprecated: 3.0 since: 2.22
gtk_text_view_get_indent
Gets the default indentation of paragraphs in text_view
.
Tags in the view’s buffer may override the default.
The indentation may be negative.
gtk_text_view_get_input_purpose
Gets the value of the GtkTextView:input-purpose
property.
since: 3.6
gtk_text_view_get_iter_at_location
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 gtk_text_view_window_to_buffer_coords().
gtk_text_view_get_iter_at_position
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 gtk_text_view_window_to_buffer_coords().
since: 2.6
gtk_text_view_get_iter_location
Gets a rectangle which roughly contains the character at iter
.
The rectangle position is in buffer coordinates; use
gtk_text_view_buffer_to_window_coords()
to convert these
coordinates to coordinates for one of the windows in the text view.
gtk_text_view_get_justification
Gets the default justification of paragraphs in text_view
.
Tags in the buffer may override the default.
gtk_text_view_get_left_margin
Gets the default left margin size of paragraphs in the text_view
.
Tags in the buffer may override the default.
gtk_text_view_get_line_at_y
Gets the GtkTextIter
at the start of the line containing
the coordinate y
. y
is in buffer coordinates, convert from
window coordinates with gtk_text_view_window_to_buffer_coords().
If non-NULL
, line_top
will be filled with the coordinate of the top
edge of the line.
gtk_text_view_get_line_yrange
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 gtk_text_view_buffer_to_window_coords().
gtk_text_view_get_pixels_above_lines
Gets the default number of pixels to put above paragraphs.
Adding this function with gtk_text_view_get_pixels_below_lines()
is equal to the line space between each paragraph.
gtk_text_view_get_right_margin
Gets the default right margin for text in text_view
. Tags
in the buffer may override the default.
gtk_text_view_get_tabs
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().
gtk_text_view_get_vadjustment
Gets the vertical-scrolling GtkAdjustment
.
deprecated: 3.0 since: 2.22
gtk_text_view_get_visible_rect
Fills visible_rect
with the currently-visible
region of the buffer, in buffer coordinates. Convert to window coordinates
with gtk_text_view_buffer_to_window_coords().
gtk_text_view_get_window
Retrieves the GdkWindow
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.
gtk_text_view_im_context_filter_keypress
Allow the GtkTextView
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().
since: 2.22
gtk_text_view_move_child
Updates the position of a child, as for gtk_text_view_add_child_in_window().
gtk_text_view_move_mark_onscreen
Moves a mark within the buffer so that it’s located within the currently-visible text area.
gtk_text_view_move_visually
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.
gtk_text_view_place_cursor_onscreen
Moves the cursor to the currently visible region of the buffer, it it isn’t there already.
gtk_text_view_reset_cursor_blink
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).
since: 3.20
gtk_text_view_reset_im_context
Reset the input method context of the text view if needed.
since: 2.22
gtk_text_view_scroll_mark_onscreen
Scrolls text_view
the minimum distance such that mark
is contained
within the visible area of the widget.
gtk_text_view_scroll_to_iter
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
.
gtk_text_view_scroll_to_mark
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
.
gtk_text_view_set_accepts_tab
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.
since: 2.4
gtk_text_view_set_border_window_size
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
.
gtk_text_view_set_buffer
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; GtkTextView
will not “adopt” it.
gtk_text_view_set_cursor_visible
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.
gtk_text_view_set_editable
Sets the default editability of the GtkTextView
. You can override
this default setting with tags in the buffer, using the “editable”
attribute of tags.
gtk_text_view_set_indent
Sets the default indentation for paragraphs in text_view
.
Tags in the buffer may override the default.
gtk_text_view_set_input_hints
Sets the GtkTextView:input-hints
property, which
allows input methods to fine-tune their behaviour.
since: 3.6
gtk_text_view_set_input_purpose
Sets the GtkTextView:input-purpose
property which
can be used by on-screen keyboards and other input
methods to adjust their behaviour.
since: 3.6
gtk_text_view_set_justification
Sets the default justification of text in text_view
.
Tags in the view’s buffer may override the default.
gtk_text_view_set_left_margin
Sets the default left margin for text in text_view
.
Tags in the buffer may override the default.
gtk_text_view_set_monospace
Sets the GtkTextView:monospace
property, which
indicates that the text view should use monospace fonts.
since: 3.16
gtk_text_view_set_pixels_above_lines
Sets the default number of blank pixels above paragraphs in text_view
.
Tags in the buffer for text_view
may override the defaults.
gtk_text_view_set_pixels_below_lines
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.
gtk_text_view_set_pixels_inside_wrap
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.
gtk_text_view_set_right_margin
Sets the default right margin for text in the text view. Tags in the buffer may override the default.
gtk_text_view_set_tabs
Sets the default tab stops for paragraphs in text_view
.
Tags in the buffer may override the default.
gtk_text_view_starts_display_line
Determines whether iter
is at the start of a display line.
See gtk_text_view_forward_display_line()
for an explanation of
display lines vs. paragraphs.
gtk_text_view_window_to_buffer_coords
Converts coordinates on the window identified by win
to buffer
coordinates, storing the result in (buffer_x
,buffer_y
).
Methods inherited from GtkContainer (33)
Please see GtkContainer for a full list of methods.
Methods inherited from GtkBuildable (10)
gtk_buildable_add_child
Adds a child to buildable
. type
is an optional string
describing how the child should be added.
since: 2.12
gtk_buildable_construct_child
Constructs a child of buildable
with the name name
.
since: 2.12
gtk_buildable_custom_finished
This is similar to gtk_buildable_parser_finished()
but is
called once for each custom tag handled by the buildable
.
since: 2.12
gtk_buildable_custom_tag_end
This is called at the end of each custom element handled by the buildable.
since: 2.12
gtk_buildable_custom_tag_start
This is called for each unknown element under <child>
.
since: 2.12
gtk_buildable_get_internal_child
Get the internal child called childname
of the buildable
object.
since: 2.12
gtk_buildable_get_name
Gets the name of the buildable
object.
since: 2.12
gtk_buildable_parser_finished
Called when the builder finishes the parsing of a
[GtkBuilder UI definition][BUILDER-UI].
Note that this will be called once for each time
gtk_builder_add_from_file()
or gtk_builder_add_from_string()
is called on a builder.
since: 2.12
gtk_buildable_set_buildable_property
Sets the property name name
to value
on the buildable
object.
since: 2.12
gtk_buildable_set_name
Sets the name of the buildable
object.
since: 2.12
Methods inherited from GtkScrollable (9)
gtk_scrollable_get_border
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.
since: 3.16
gtk_scrollable_get_hadjustment
Retrieves the GtkAdjustment
used for horizontal scrolling.
since: 3.0
gtk_scrollable_get_hscroll_policy
Gets the horizontal GtkScrollablePolicy
.
since: 3.0
gtk_scrollable_get_vadjustment
Retrieves the GtkAdjustment
used for vertical scrolling.
since: 3.0
gtk_scrollable_get_vscroll_policy
Gets the vertical GtkScrollablePolicy
.
since: 3.0
gtk_scrollable_set_hadjustment
Sets the horizontal adjustment of the GtkScrollable
.
since: 3.0
gtk_scrollable_set_hscroll_policy
Sets the GtkScrollablePolicy
to determine whether
horizontal scrolling should start below the minimum width or
below the natural width.
since: 3.0
gtk_scrollable_set_vadjustment
Sets the vertical adjustment of the GtkScrollable
.
since: 3.0
gtk_scrollable_set_vscroll_policy
Sets the GtkScrollablePolicy
to determine whether
vertical scrolling should start below the minimum height or
below the natural height.
since: 3.0
Properties
Gtk.TextView:im-module
Which IM (input method) module should be used for this text_view.
See GtkIMContext
.
since: 2.16
Gtk.TextView:input-hints
Additional hints (beyond GtkTextView:input-purpose
) that
allow input methods to fine-tune their behaviour.
since: 3.6
Gtk.TextView:left-margin
The default left margin for text in the text view. Tags in the buffer may override the default.
Gtk.TextView:populate-all
If :populate-all is TRUE
, the GtkTextView::populate-popup
signal is also emitted for touch popups.
since: 3.8
Gtk.TextView:right-margin
The default right margin for text in the text view. Tags in the buffer may override the default.
Properties inherited from GtkContainer (3)
Gtk.Container:border-width
Gtk.Container:child
Gtk.Container:resize-mode
Properties inherited from GtkWidget (39)
Gtk.Widget:app-paintable
Gtk.Widget:can-default
Gtk.Widget:can-focus
Gtk.Widget:composite-child
Gtk.Widget:double-buffered
Whether the widget is double buffered.
deprecated: 3.14 since: 2.18
Gtk.Widget:events
Gtk.Widget:expand
Whether to expand in both directions. Setting this sets both GtkWidget:hexpand
and GtkWidget:vexpand
.
since: 3.0
Gtk.Widget:focus-on-click
Whether the widget should grab focus when it is clicked with the mouse.
since: 3.20
Gtk.Widget:halign
How to distribute horizontal space if widget gets extra space, see GtkAlign
.
since: 3.0
Gtk.Widget:has-default
Gtk.Widget:has-focus
Gtk.Widget:has-tooltip
Enables or disables the emission of GtkWidget::query-tooltip
on widget
.
A value of TRUE
indicates that widget
can have a tooltip, in this case
the widget will be queried using GtkWidget::query-tooltip
to determine
whether it will provide a tooltip or not.
since: 2.12
Gtk.Widget:height-request
Gtk.Widget:hexpand
Whether to expand horizontally. See gtk_widget_set_hexpand().
since: 3.0
Gtk.Widget:hexpand-set
Whether to use the GtkWidget:hexpand
property. See gtk_widget_get_hexpand_set().
since: 3.0
Gtk.Widget:is-focus
Gtk.Widget:margin
Sets all four sides’ margin at once. If read, returns max margin on any side.
since: 3.0
Gtk.Widget:margin-bottom
Margin on bottom side of widget.
since: 3.0
Gtk.Widget:margin-end
Margin on end of widget, horizontally. This property supports left-to-right and right-to-left text directions.
since: 3.12
Gtk.Widget:margin-left
Margin on left side of widget.
deprecated: 3.12 since: 3.0
Gtk.Widget:margin-right
Margin on right side of widget.
deprecated: 3.12 since: 3.0
Gtk.Widget:margin-start
Margin on start of widget, horizontally. This property supports left-to-right and right-to-left text directions.
since: 3.12
Gtk.Widget:margin-top
Margin on top side of widget.
since: 3.0
Gtk.Widget:name
Gtk.Widget:no-show-all
Gtk.Widget:opacity
The requested opacity of the widget. See gtk_widget_set_opacity()
for
more details about window opacity.
since: 3.8
Gtk.Widget:parent
Gtk.Widget:receives-default
Gtk.Widget:scale-factor
The scale factor of the widget. See gtk_widget_get_scale_factor()
for
more details about widget scaling.
since: 3.10
Gtk.Widget:sensitive
Gtk.Widget:style
The style of the widget, which contains information about how it will look (colors, etc).
deprecated: Unknown
Gtk.Widget:tooltip-markup
Sets the text of tooltip to be the given string, which is marked up with the [Pango text markup language][PangoMarkupFormat]. Also see gtk_tooltip_set_markup().
since: 2.12
Gtk.Widget:tooltip-text
Sets the text of tooltip to be the given string.
since: 2.12
Gtk.Widget:valign
How to distribute vertical space if widget gets extra space, see GtkAlign
.
since: 3.0
Gtk.Widget:vexpand
Whether to expand vertically. See gtk_widget_set_vexpand().
since: 3.0
Gtk.Widget:vexpand-set
Whether to use the GtkWidget:vexpand
property. See gtk_widget_get_vexpand_set().
since: 3.0
Gtk.Widget:visible
Gtk.Widget:width-request
Gtk.Widget:window
The widget’s window if it is realized, NULL
otherwise.
since: 2.14
Properties inherited from GtkScrollable (4)
GtkScrollable:hadjustment
Horizontal GtkAdjustment
of the scrollable widget. This adjustment is
shared between the scrollable widget and its parent.
since: 3.0
GtkScrollable:hscroll-policy
Determines whether horizontal scrolling should start once the scrollable widget is allocated less than its minimum width or less than its natural width.
since: 3.0
GtkScrollable:vadjustment
Verical GtkAdjustment
of the scrollable widget. This adjustment is shared
between the scrollable widget and its parent.
since: 3.0
GtkScrollable:vscroll-policy
Determines whether vertical scrolling should start once the scrollable widget is allocated less than its minimum height or less than its natural height.
since: 3.0
Signals
Gtk.TextView::backspace
The ::backspace signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user asks for it.
Gtk.TextView::copy-clipboard
The ::copy-clipboard signal is a [keybinding signal][GtkBindingSignal] which gets emitted to copy the selection to the clipboard.
Gtk.TextView::cut-clipboard
The ::cut-clipboard signal is a [keybinding signal][GtkBindingSignal] which gets emitted to cut the selection to the clipboard.
Gtk.TextView::delete-from-cursor
The ::delete-from-cursor signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user initiates a text deletion.
Gtk.TextView::extend-selection
The ::extend-selection signal is emitted when the selection needs to be
extended at location
.
since: 3.16
Gtk.TextView::insert-at-cursor
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.
Gtk.TextView::insert-emoji
The ::insert-emoji signal is a
[keybinding signal][GtkBindingSignal]
which gets emitted to present the Emoji chooser for the text_view
.
since: 3.22.27
Gtk.TextView::move-cursor
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.
Gtk.TextView::move-viewport
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.
Gtk.TextView::paste-clipboard
The ::paste-clipboard signal is a [keybinding signal][GtkBindingSignal] which gets emitted to paste the contents of the clipboard into the text view.
Gtk.TextView::populate-popup
The ::populate-popup signal gets emitted before showing the context menu of the text view.
Gtk.TextView::preedit-changed
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.
since: 2.20
Gtk.TextView::select-all
The ::select-all signal is a [keybinding signal][GtkBindingSignal] which gets emitted to select or unselect the complete contents of the text view.
Gtk.TextView::set-anchor
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.
Gtk.TextView::toggle-cursor-visible
The ::toggle-cursor-visible signal is a
[keybinding signal][GtkBindingSignal]
which gets emitted to toggle the GtkTextView:cursor-visible
property.
Gtk.TextView::toggle-overwrite
The ::toggle-overwrite signal is a [keybinding signal][GtkBindingSignal] which gets emitted to toggle the overwrite mode of the text view.
Signals inherited from GtkContainer (4)
GtkContainer::add
GtkContainer::check-resize
GtkContainer::remove
GtkContainer::set-focus-child
Signals inherited from GtkWidget (69)
GtkWidget::accel-closures-changed
GtkWidget::button-press-event
The ::button-press-event signal will be emitted when a button (typically from a mouse) is pressed.
GtkWidget::button-release-event
The ::button-release-event signal will be emitted when a button (typically from a mouse) is released.
GtkWidget::can-activate-accel
Determines whether an accelerator that activates the signal
identified by signal_id
can currently be activated.
This signal is present to allow applications and derived
widgets to override the default GtkWidget
handling
for determining whether an accelerator can be activated.
GtkWidget::child-notify
The ::child-notify signal is emitted for each [child property][child-properties] that has changed on an object. The signal’s detail holds the property name.
GtkWidget::composited-changed
The ::composited-changed signal is emitted when the composited
status of widgets
screen changes.
See gdk_screen_is_composited().
deprecated: 3.22
GtkWidget::configure-event
The ::configure-event signal will be emitted when the size, position or
stacking of the widget
‘s window has changed.
GtkWidget::damage-event
Emitted when a redirected window belonging to widget
gets drawn into.
The region/area members of the event shows what area of the redirected
drawable was drawn into.
since: 2.14
GtkWidget::delete-event
The ::delete-event signal is emitted if a user requests that
a toplevel window is closed. The default handler for this signal
destroys the window. Connecting gtk_widget_hide_on_delete()
to
this signal will cause the window to be hidden instead, so that
it can later be shown again without reconstructing it.
GtkWidget::destroy
Signals that all holders of a reference to the widget should release the reference that they hold. May result in finalization of the widget if all references are released.
GtkWidget::destroy-event
The ::destroy-event signal is emitted when a GdkWindow
is destroyed.
You rarely get this signal, because most widgets disconnect themselves
from their window before they destroy it, so no widget owns the
window at destroy time.
GtkWidget::direction-changed
The ::direction-changed signal is emitted when the text direction of a widget changes.
GtkWidget::drag-begin
The ::drag-begin signal is emitted on the drag source when a drag is started. A typical reason to connect to this signal is to set up a custom drag icon with e.g. gtk_drag_source_set_icon_pixbuf().
GtkWidget::drag-data-delete
The ::drag-data-delete signal is emitted on the drag source when a drag
with the action GDK_ACTION_MOVE
is successfully completed. The signal
handler is responsible for deleting the data that has been dropped. What
“delete” means depends on the context of the drag operation.
GtkWidget::drag-data-get
The ::drag-data-get signal is emitted on the drag source when the drop
site requests the data which is dragged. It is the responsibility of
the signal handler to fill data
with the data in the format which
is indicated by info
. See gtk_selection_data_set()
and gtk_selection_data_set_text().
GtkWidget::drag-data-received
The ::drag-data-received signal is emitted on the drop site when the
dragged data has been received. If the data was received in order to
determine whether the drop will be accepted, the handler is expected
to call gdk_drag_status()
and not finish the drag.
If the data was received in response to a GtkWidget::drag-drop
signal
(and this is the last target to be received), the handler for this
signal is expected to process the received data and then call
gtk_drag_finish(), setting the success
parameter depending on
whether the data was processed successfully.
GtkWidget::drag-drop
The ::drag-drop signal is emitted on the drop site when the user drops
the data onto the widget. The signal handler must determine whether
the cursor position is in a drop zone or not. If it is not in a drop
zone, it returns FALSE
and no further processing is necessary.
Otherwise, the handler returns TRUE
. In this case, the handler must
ensure that gtk_drag_finish()
is called to let the source know that
the drop is done. The call to gtk_drag_finish()
can be done either
directly or in a GtkWidget::drag-data-received
handler which gets
triggered by calling gtk_drag_get_data()
to receive the data for one
or more of the supported targets.
GtkWidget::drag-end
The ::drag-end signal is emitted on the drag source when a drag is
finished. A typical reason to connect to this signal is to undo
things done in GtkWidget::drag-begin
.
GtkWidget::drag-failed
The ::drag-failed signal is emitted on the drag source when a drag has
failed. The signal handler may hook custom code to handle a failed DnD
operation based on the type of error, it returns TRUE
is the failure has
been already handled (not showing the default “drag operation failed”
animation), otherwise it returns FALSE
.
since: 2.12
GtkWidget::drag-leave
The ::drag-leave signal is emitted on the drop site when the cursor
leaves the widget. A typical reason to connect to this signal is to
undo things done in GtkWidget::drag-motion
, e.g. undo highlighting
with gtk_drag_unhighlight().
GtkWidget::drag-motion
The ::drag-motion signal is emitted on the drop site when the user
moves the cursor over the widget during a drag. The signal handler
must determine whether the cursor position is in a drop zone or not.
If it is not in a drop zone, it returns FALSE
and no further processing
is necessary. Otherwise, the handler returns TRUE
. In this case, the
handler is responsible for providing the necessary information for
displaying feedback to the user, by calling gdk_drag_status().
GtkWidget::draw
This signal is emitted when a widget is supposed to render itself.
The widget
‘s top left corner must be painted at the origin of
the passed in context and be sized to the values returned by
gtk_widget_get_allocated_width()
and gtk_widget_get_allocated_height().
since: 3.0
GtkWidget::enter-notify-event
The ::enter-notify-event will be emitted when the pointer enters
the widget
‘s window.
GtkWidget::event
The GTK+ main loop will emit three signals for each GDK event delivered
to a widget: one generic ::event signal, another, more specific,
signal that matches the type of event delivered (e.g.
GtkWidget::key-press-event
) and finally a generic
GtkWidget::event-after
signal.
GtkWidget::event-after
After the emission of the GtkWidget::event
signal and (optionally)
the second more specific signal, ::event-after will be emitted
regardless of the previous two signals handlers return values.
GtkWidget::focus
GtkWidget::focus-in-event
The ::focus-in-event signal will be emitted when the keyboard focus
enters the widget
‘s window.
GtkWidget::focus-out-event
The ::focus-out-event signal will be emitted when the keyboard focus
leaves the widget
‘s window.
GtkWidget::grab-broken-event
Emitted when a pointer or keyboard grab on a window belonging
to widget
gets broken.
since: 2.8
GtkWidget::grab-focus
GtkWidget::grab-notify
The ::grab-notify signal is emitted when a widget becomes shadowed by a GTK+ grab (not a pointer or keyboard grab) on another widget, or when it becomes unshadowed due to a grab being removed.
GtkWidget::hide
The ::hide signal is emitted when widget
is hidden, for example with gtk_widget_hide().
GtkWidget::hierarchy-changed
The ::hierarchy-changed signal is emitted when the
anchored state of a widget changes. A widget is
“anchored” when its toplevel
ancestor is a GtkWindow
. This signal is emitted when
a widget changes from un-anchored to anchored or vice-versa.
GtkWidget::key-press-event
The ::key-press-event signal is emitted when a key is pressed. The signal emission will reoccur at the key-repeat rate when the key is kept pressed.
GtkWidget::key-release-event
The ::key-release-event signal is emitted when a key is released.
GtkWidget::keynav-failed
Gets emitted if keyboard navigation fails.
See gtk_widget_keynav_failed()
for details.
since: 2.12
GtkWidget::leave-notify-event
The ::leave-notify-event will be emitted when the pointer leaves
the widget
‘s window.
GtkWidget::map
The ::map signal is emitted when widget
is going to be mapped, that is
when the widget is visible (which is controlled with
gtk_widget_set_visible()) and all its parents up to the toplevel widget
are also visible. Once the map has occurred, GtkWidget::map-event
will
be emitted.
GtkWidget::map-event
The ::map-event signal will be emitted when the widget
‘s window is
mapped. A window is mapped when it becomes visible on the screen.
GtkWidget::mnemonic-activate
The default handler for this signal activates widget
if group_cycling
is FALSE
, or just makes widget
grab focus if group_cycling
is TRUE
.
GtkWidget::motion-notify-event
The ::motion-notify-event signal is emitted when the pointer moves
over the widget’s GdkWindow
.
GtkWidget::move-focus
GtkWidget::parent-set
The ::parent-set signal is emitted when a new parent has been set on a widget.
GtkWidget::popup-menu
This signal gets emitted whenever a widget should pop up a context
menu. This usually happens through the standard key binding mechanism;
by pressing a certain key while a widget is focused, the user can cause
the widget to pop up a menu. For example, the GtkEntry
widget creates
a menu with clipboard commands. See the
[Popup Menu Migration Checklist][checklist-popup-menu]
for an example of how to use this signal.
GtkWidget::property-notify-event
The ::property-notify-event signal will be emitted when a property on
the widget
‘s window has been changed or deleted.
GtkWidget::proximity-in-event
To receive this signal the GdkWindow
associated to the widget needs
to enable the #GDK_PROXIMITY_IN_MASK mask.
GtkWidget::proximity-out-event
To receive this signal the GdkWindow
associated to the widget needs
to enable the #GDK_PROXIMITY_OUT_MASK mask.
GtkWidget::query-tooltip
Emitted when GtkWidget:has-tooltip
is TRUE
and the hover timeout
has expired with the cursor hovering “above” widget
; or emitted when widget
got
focus in keyboard mode.
since: 2.12
GtkWidget::realize
The ::realize signal is emitted when widget
is associated with a
GdkWindow
, which means that gtk_widget_realize()
has been called or the
widget has been mapped (that is, it is going to be drawn).
GtkWidget::screen-changed
The ::screen-changed signal gets emitted when the screen of a widget has changed.
GtkWidget::scroll-event
The ::scroll-event signal is emitted when a button in the 4 to 7 range is pressed. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned.
GtkWidget::selection-clear-event
The ::selection-clear-event signal will be emitted when the
the widget
‘s window has lost ownership of a selection.
GtkWidget::selection-get
GtkWidget::selection-notify-event
GtkWidget::selection-received
GtkWidget::selection-request-event
The ::selection-request-event signal will be emitted when
another client requests ownership of the selection owned by
the widget
‘s window.
GtkWidget::show
The ::show signal is emitted when widget
is shown, for example with gtk_widget_show().
GtkWidget::show-help
GtkWidget::size-allocate
GtkWidget::state-changed
The ::state-changed signal is emitted when the widget state changes. See gtk_widget_get_state().
deprecated: 3.0
GtkWidget::state-flags-changed
The ::state-flags-changed signal is emitted when the widget state changes, see gtk_widget_get_state_flags().
since: 3.0
GtkWidget::style-set
The ::style-set signal is emitted when a new style has been set
on a widget. Note that style-modifying functions like
gtk_widget_modify_base()
also cause this signal to be emitted.
deprecated: 3.0
GtkWidget::style-updated
The ::style-updated signal is a convenience signal that is emitted when the
GtkStyleContext::changed
signal is emitted on the widget
‘s associated
GtkStyleContext
as returned by gtk_widget_get_style_context().
since: 3.0
GtkWidget::touch-event
GtkWidget::unmap
The ::unmap signal is emitted when widget
is going to be unmapped, which
means that either it or any of its parents up to the toplevel widget have
been set as hidden.
GtkWidget::unmap-event
The ::unmap-event signal will be emitted when the widget
‘s window is
unmapped. A window is unmapped when it becomes invisible on the screen.
GtkWidget::unrealize
The ::unrealize signal is emitted when the GdkWindow
associated with
widget
is destroyed, which means that gtk_widget_unrealize()
has been
called or the widget has been unmapped (that is, it is going to be hidden).
GtkWidget::visibility-notify-event
The ::visibility-notify-event will be emitted when the widget
‘s
window is obscured or unobscured.
deprecated: 3.12
GtkWidget::window-state-event
The ::window-state-event will be emitted when the state of the
toplevel window associated to the widget
changes.
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Class structure
struct GtkTextViewClass {
GtkContainerClass parent_class;
void (* populate_popup) (
GtkTextView* text_view,
GtkWidget* popup
);
void (* move_cursor) (
GtkTextView* text_view,
GtkMovementStep step,
gint count,
gboolean extend_selection
);
void (* set_anchor) (
GtkTextView* text_view
);
void (* insert_at_cursor) (
GtkTextView* text_view,
const gchar* str
);
void (* delete_from_cursor) (
GtkTextView* text_view,
GtkDeleteType type,
gint count
);
void (* backspace) (
GtkTextView* text_view
);
void (* cut_clipboard) (
GtkTextView* text_view
);
void (* copy_clipboard) (
GtkTextView* text_view
);
void (* paste_clipboard) (
GtkTextView* text_view
);
void (* toggle_overwrite) (
GtkTextView* text_view
);
GtkTextBuffer* (* create_buffer) (
GtkTextView* text_view
);
void (* draw_layer) (
GtkTextView* text_view,
GtkTextViewLayer layer,
cairo_t* cr
);
gboolean (* extend_selection) (
GtkTextView* text_view,
GtkTextExtendSelection granularity,
const GtkTextIter* location,
GtkTextIter* start,
GtkTextIter* end
);
void (* insert_emoji) (
GtkTextView* text_view
);
void (* _gtk_reserved1) (
void
);
void (* _gtk_reserved2) (
void
);
void (* _gtk_reserved3) (
void
);
void (* _gtk_reserved4) (
void
);
}
No description available.
Class members
parent_class: GtkContainerClass
The object class structure needs to be the first.
populate_popup: void (* populate_popup) ( GtkTextView* text_view, GtkWidget* popup )
The class handler for the
GtkTextView::populate-popup
signal.move_cursor: void (* move_cursor) ( GtkTextView* text_view, GtkMovementStep step, gint count, gboolean extend_selection )
The class handler for the
GtkTextView::move-cursor
keybinding signal.set_anchor: void (* set_anchor) ( GtkTextView* text_view )
The class handler for the
GtkTextView::set-anchor
keybinding signal.insert_at_cursor: void (* insert_at_cursor) ( GtkTextView* text_view, const gchar* str )
The class handler for the
GtkTextView::insert-at-cursor
keybinding signal.delete_from_cursor: void (* delete_from_cursor) ( GtkTextView* text_view, GtkDeleteType type, gint count )
The class handler for the
GtkTextView::delete-from-cursor
keybinding signal.backspace: void (* backspace) ( GtkTextView* text_view )
The class handler for the
GtkTextView::backspace
keybinding signal.cut_clipboard: void (* cut_clipboard) ( GtkTextView* text_view )
The class handler for the
GtkTextView::cut-clipboard
keybinding signal.copy_clipboard: void (* copy_clipboard) ( GtkTextView* text_view )
The class handler for the
GtkTextview::copy-clipboard
keybinding signal.paste_clipboard: void (* paste_clipboard) ( GtkTextView* text_view )
The class handler for the
GtkTextView::paste-clipboard
keybinding signal.toggle_overwrite: void (* toggle_overwrite) ( GtkTextView* text_view )
The class handler for the
GtkTextView::toggle-overwrite
keybinding signal.create_buffer: GtkTextBuffer* (* create_buffer) ( GtkTextView* text_view )
The create_buffer vfunc is called to create a
GtkTextBuffer
for the text view. The default implementation is to just call gtk_text_buffer_new(). Since: 3.10.draw_layer: void (* draw_layer) ( GtkTextView* text_view, GtkTextViewLayer layer, cairo_t* cr )
The draw_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
GTK_TEXT_VIEW_LAYER_BELOW_TEXT
andGTK_TEXT_VIEW_LAYER_ABOVE_TEXT
the drawing is done in the buffer coordinate space, but the older (deprecated) layersGTK_TEXT_VIEW_LAYER_BELOW
andGTK_TEXT_VIEW_LAYER_ABOVE
work in viewport coordinates, which makes them unnecessarily hard to use. Since: 3.14.extend_selection: gboolean (* extend_selection) ( GtkTextView* text_view, GtkTextExtendSelection granularity, const GtkTextIter* location, GtkTextIter* start, GtkTextIter* end )
The class handler for the
GtkTextView::extend-selection
signal. Since 3.16.insert_emoji: void (* insert_emoji) ( GtkTextView* text_view )
No description available.
_gtk_reserved1: void (* _gtk_reserved1) ( void )
No description available.
_gtk_reserved2: void (* _gtk_reserved2) ( void )
No description available.
_gtk_reserved3: void (* _gtk_reserved3) ( void )
No description available.
_gtk_reserved4: void (* _gtk_reserved4) ( void )
No description available.
Virtual methods
Gtk.TextViewClass.copy_clipboard
The class handler for the GtkTextview::copy-clipboard
keybinding signal.
Gtk.TextViewClass.create_buffer
The create_buffer vfunc is called to create a GtkTextBuffer
for the text view. The default implementation is to just call
gtk_text_buffer_new(). Since: 3.10.
Gtk.TextViewClass.cut_clipboard
The class handler for the GtkTextView::cut-clipboard
keybinding signal.
Gtk.TextViewClass.delete_from_cursor
The class handler for the GtkTextView::delete-from-cursor
keybinding signal.
Gtk.TextViewClass.draw_layer
The draw_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 GTK_TEXT_VIEW_LAYER_BELOW_TEXT
and GTK_TEXT_VIEW_LAYER_ABOVE_TEXT
the drawing is done in the buffer coordinate space, but the older (deprecated)
layers GTK_TEXT_VIEW_LAYER_BELOW
and GTK_TEXT_VIEW_LAYER_ABOVE
work in viewport
coordinates, which makes them unnecessarily hard to use. Since: 3.14.
Gtk.TextViewClass.extend_selection
The class handler for the GtkTextView::extend-selection
signal. Since 3.16.
Gtk.TextViewClass.insert_at_cursor
The class handler for the GtkTextView::insert-at-cursor
keybinding signal.
Gtk.TextViewClass.paste_clipboard
The class handler for the GtkTextView::paste-clipboard
keybinding signal.
Gtk.TextViewClass.toggle_overwrite
The class handler for the GtkTextView::toggle-overwrite
keybinding signal.