Sets our main struct and passes it to the parent class
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().
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.
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 window must have nonzero size (see gtk_text_view_set_border_window_size()). Note that the child coordinates are given relative to the GdkWindow in question, and that these coordinates have no sane relationship to scrolling. When placing a child in GTK_TEXT_WINDOW_WIDGET, scrolling is irrelevant, the child floats above all scrollable areas. But when placing a child in one of the scrollable windows (border windows or text window), you'll need to compute the child's correct position in buffer coordinates any time scrolling occurs or buffer changes occur, and then call gtk_text_view_move_child() to update the child's position. Unfortunately there's no good way to detect that scrolling has occurred, using the current API; a possible hack would be to update all child positions when the scroll adjustments change or the text buffer changes. See bug 64518 on bugzilla.gnome.org for status of fixing this issue.
The ::backspace signal is a keybinding signal which gets emitted when the user asks for it. The default bindings for this signal are Backspace and Shift-Backspace.
The ::copy-clipboard signal is a keybinding signal which gets emitted to copy the selection to the clipboard. The default bindings for this signal are Ctrl-c and Ctrl-Insert.
The ::cut-clipboard signal is a keybinding signal which gets emitted to cut the selection to the clipboard. The default bindings for this signal are Ctrl-x and Shift-Delete.
The ::delete-from-cursor signal is a keybinding signal which gets emitted when the user initiates a text deletion. If the type is GTK_DELETE_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 backwords.
The ::insert-at-cursor signal is a keybinding signal which gets emitted when the user initiates the insertion of a fixed string at the cursor. This signal has no default bindings.
The ::move-cursor signal is a keybinding signal 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. 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 the Shift modifer does not. There are too many key combinations to list them all here. Arrow keys move by individual characters/lines Ctrl-arrow key combinations move by words/paragraphs Home/End keys move to the ends of the buffer PageUp/PageDown keys move vertically by pages Ctrl-PageUp/PageDown keys move horizontally by pages TRUE if the move should extend the selection
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.
The ::page-horizontally signal is a keybinding signal which can be bound to key combinations to allow the user to initiate horizontal cursor movement by pages. This signal should not be used anymore, instead use the "move-cursor" signal with the GTK_MOVEMENT_HORIZONTAL_PAGES granularity. TRUE if the move should extend the selection
The ::paste-clipboard signal is a keybinding signal which gets emitted to paste the contents of the clipboard into the text view. The default bindings for this signal are Ctrl-v and Shift-Insert.
The ::populate-popup signal gets emitted before showing the context menu of the text view. If you need to add items to the context menu, connect to this signal and append your menuitems to the menu.
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. Since 2.20
The ::select-all signal is a keybinding signal which gets emitted to select or unselect the complete contents of the text view. The default bindings for this signal are Ctrl-a and Ctrl-/ for selecting and Shift-Ctrl-a and Ctrl-\ for unselecting. TRUE to select, FALSE to unselect
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.
Set the scroll adjustments for the text view. Usually scrolled containers like GtkScrolledWindow will emit this signal to connect two instances of GtkScrollbar to the scroll directions of the GtkTextView.
The ::toggle-cursor-visible signal is a keybinding signal which gets emitted to toggle the visibility of the cursor. The default binding for this signal is F7.
The ::toggle-overwrite signal is a keybinding signal which gets emitted to toggle the overwrite mode of the text view. The default bindings for this signal is Insert. See Also GtkTextBuffer, GtkTextIter
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 GtkTextBuffer.
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.
Converts coordinate (buffer_x, buffer_y) to coordinates for the window win, and stores the result in (window_x, window_y). Note that you can't convert coordinates for a nonexisting window (see gtk_text_view_set_border_window_size()).
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.
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.
Returns whether pressing the Tab key inserts a tab characters. gtk_text_view_set_accepts_tab(). Since 2.4
Gets the width of the specified border window. See gtk_text_view_set_border_window_size().
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.
Find out whether the cursor is being 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 gtk_text_iter_get_attributes() in order to get the attributes in effect at a given text position. The return value is a copy owned by the caller of this function, and should be freed.
Returns the default editability of the GtkTextView. Tags in the buffer may override this setting for some ranges of text.
Gets the horizontal-scrolling GtkAdjustment. Since 2.22
Gets the default indentation of paragraphs in text_view. Tags in the view's buffer may override the default. The indentation may be negative.
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().
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(). Note that this is different from gtk_text_view_get_iter_at_location(), which returns cursor locations, i.e. positions between characters. Since 2.6
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.
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 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.
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 gtk_text_view_buffer_to_window_coords().
Returns whether the GtkTextView is in overwrite mode or not. Since 2.4
Gets the default number of pixels to put above paragraphs.
Gets the value set by gtk_text_view_set_pixels_below_lines().
Gets the value set by gtk_text_view_set_pixels_inside_wrap().
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().
Gets the vertical-scrolling GtkAdjustment. Since 2.22
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().
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.
Usually used to find out which window an event corresponds to. If you connect to an event signal on text_view, this function should be called on event->window to see which window it was.
Gets the line wrapping for the view.
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(). 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. Since 2.22
Simply appends some on the cursor position
Updates the position of a child, as for gtk_text_view_add_child_in_window().
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. 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.
Moves the cursor to the currently visible region of the buffer, it it isn't there already.
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. Since 2.22
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. 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 gtk_text_view_scroll_to_mark() which saves a point to be scrolled to after line validation.
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. Since 2.4
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," it doesn't work with GTK_TEXT_WINDOW_WIDGET, GTK_TEXT_WINDOW_TEXT, or GTK_TEXT_WINDOW_PRIVATE.
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.
Toggles whether the insertion point is 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 GtkTextView. 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 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.
Changes the GtkTextView overwrite mode. Since 2.4
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 line wrapping for the view.
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.
Converts coordinates on the window identified by win to buffer coordinates, storing the result in (buffer_x,buffer_y). Note that you can't convert coordinates for a nonexisting window (see gtk_text_view_set_border_window_size()).
the main Gtk struct
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 GtkWindow, GtkFrame, or GtkButton; for more complicated layout containers such as GtkBox or GtkTable, this function will pick default packing parameters that may not be correct. So consider functions such as gtk_box_pack_start() and gtk_table_attach() as an alternative to gtk_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.
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 while it's not inside 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 gtk_widget_destroy() since this will remove it from the container and help break any circular reference count cycles.
Returns the resize mode for the container. See gtk_container_set_resize_mode().
Sets the resize mode for the container. The resize mode of a container determines whether a resize request will be passed to the container's parent, queued for later execution or executed immediately.
Invokes callback on each non-internal child of container. See gtk_container_forall() for details on what constitutes an "internal" child. Most applications should use gtk_container_foreach(), rather than gtk_container_forall().
Warning gtk_container_foreach_full is deprecated and should not be used in newly-written code. Use gtk_container_foreach() instead.
Returns the container's non-internal children. See gtk_container_forall() for details on what constitutes an "internal" child.
Sets the reallocate_redraws flag of the container to the given value. Containers requesting reallocation redraws get automatically redrawn if any of their children changed allocation.
Returns the current focus child widget inside container. This is not the currently focused widget. That can be obtained by calling gtk_window_get_focus(). Since 2.14
Sets, or unsets if child is NULL, the focused child of container. This function emits the GtkContainer::set_focus_child signal of container. Implementations of GtkContainer can override the default behaviour by overriding the class closure of this signal. This is function is mostly meant to be used by widgets. Applications can use gtk_widget_grab_focus() to manualy set the focus to a specific widget.
Retrieves the vertical focus adjustment for the container. See gtk_container_set_focus_vadjustment().
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 gtk_scrolled_window_get_vadjustment() for a typical way of obtaining the adjustment and gtk_container_set_focus_hadjustment() for setting the horizontal adjustment. The adjustments have to be in pixel units and in the same coordinate system as the allocation for immediate children of the container.
Retrieves the horizontal focus adjustment for the container. See gtk_container_set_focus_hadjustment().
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 gtk_scrolled_window_get_hadjustment() for a typical way of obtaining the adjustment and gtk_container_set_focus_vadjustment() for setting the vertical adjustment. The adjustments have to be in pixel units and in the same coordinate system as the allocation for immediate children of the container.
Returns the type of the children supported by the container. Note that this may return G_TYPE_NONE to indicate that no more children can be added, e.g. for a GtkPaned which already has two children.
Gets the value of a child property for child and container.
Sets a child property for child and container.
Gets the values of one or more child properties for child and container.
Sets one or more child properties for child and container.
Invokes callback on each 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. Most applications should use gtk_container_foreach(), rather than gtk_container_forall().
Retrieves the border width of the container. See gtk_container_set_border_width().
Sets the border width of the container. The border width of a container is the amount of space to leave around the outside of the container. The only exception to this is GtkWindow; because toplevel windows can't leave space outside, they leave the space inside. The border is added on all sides of the container. To add space to only one side, one approach is to create a GtkAlignment widget, call gtk_widget_set_size_request() to give it a size, and place it on the side of the container as a spacer.
When a container receives an expose event, it must send synthetic expose events to all children that don't have their own GdkWindows. This function provides a convenient way of doing this. A container, when it receives an expose event, calls gtk_container_propagate_expose() once for each child, passing in the event the container received. gtk_container_propagate_expose() takes care of deciding whether an expose event needs to be sent to the child, intersecting the event's area with the child area, and sending the event. In most cases, a container can simply either simply inherit the "expose" implementation from GtkContainer, or, do some drawing and then chain to the ::expose implementation from GtkContainer. Note that the ::expose-event signal has been replaced by a ::draw signal in GTK+ 3, and consequently, gtk_container_propagate_expose() has been replaced by gtk_container_propagate_draw(). The GTK+ 3 migration guide for hints on how to port from ::expose-event to ::draw.
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.
Sets a focus chain, overriding the one computed automatically by GTK+. In principle each widget in the chain should be a descendant of the container, but this is not enforced by this method, since it's allowed to set the focus chain before you pack the widgets, or have a widget in the chain that isn't always packed. The necessary checks are done when the focus chain is actually traversed.
Removes a focus chain explicitly set with gtk_container_set_focus_chain().
Finds a child property of a container class by name.
Installs a child property on a container class.
Returns all child properties of a container class.
Description 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.