GtkTextView

Description

Widget that displays a GtkTextBuffer

Methods and Functions

gtkTextViewNew(show = TRUE)
gtkTextViewNewWithBuffer(buffer = NULL, show = TRUE)
gtkTextViewSetBuffer(object, buffer)
gtkTextViewGetBuffer(object)
gtkTextViewScrollToMark(object, mark, within.margin, use.align = FALSE, xalign = 0.5, yalign = 0.5)
gtkTextViewScrollToIter(object, iter, within.margin, use.align = FALSE, xalign = 0.5, yalign = 0.5)
gtkTextViewScrollMarkOnscreen(object, mark)
gtkTextViewMoveMarkOnscreen(object, mark)
gtkTextViewPlaceCursorOnscreen(object)
gtkTextViewGetVisibleRect(object)
gtkTextViewGetIterLocation(object, iter)
gtkTextViewGetLineAtY(object, y)
gtkTextViewGetLineYrange(object, iter)
gtkTextViewGetIterAtLocation(object, x, y)
gtkTextViewGetIterAtPosition(object, x, y)
gtkTextViewBufferToWindowCoords(object, win, buffer.x, buffer.y)
gtkTextViewWindowToBufferCoords(object, win, window.x, window.y)
gtkTextViewGetWindow(object, win)
gtkTextViewGetWindowType(object, window)
gtkTextViewSetBorderWindowSize(object, type, size)
gtkTextViewGetBorderWindowSize(object, type)
gtkTextViewForwardDisplayLine(object, iter)
gtkTextViewBackwardDisplayLine(object, iter)
gtkTextViewForwardDisplayLineEnd(object, iter)
gtkTextViewBackwardDisplayLineStart(object, iter)
gtkTextViewStartsDisplayLine(object, iter)
gtkTextViewMoveVisually(object, iter, count)
gtkTextViewAddChildAtAnchor(object, child, anchor)
gtkTextChildAnchorNew()
gtkTextChildAnchorGetWidgets(object)
gtkTextChildAnchorGetDeleted(object)
gtkTextViewAddChildInWindow(object, child, which.window, xpos, ypos)
gtkTextViewMoveChild(object, child, xpos, ypos)
gtkTextViewSetWrapMode(object, wrap.mode)
gtkTextViewGetWrapMode(object)
gtkTextViewSetEditable(object, setting)
gtkTextViewGetEditable(object)
gtkTextViewSetCursorVisible(object, setting)
gtkTextViewGetCursorVisible(object)
gtkTextViewSetOverwrite(object, overwrite)
gtkTextViewGetOverwrite(object)
gtkTextViewSetPixelsAboveLines(object, pixels.above.lines)
gtkTextViewGetPixelsAboveLines(object)
gtkTextViewSetPixelsBelowLines(object, pixels.below.lines)
gtkTextViewGetPixelsBelowLines(object)
gtkTextViewSetPixelsInsideWrap(object, pixels.inside.wrap)
gtkTextViewGetPixelsInsideWrap(object)
gtkTextViewSetJustification(object, justification)
gtkTextViewGetJustification(object)
gtkTextViewSetLeftMargin(object, left.margin)
gtkTextViewGetLeftMargin(object)
gtkTextViewSetRightMargin(object, right.margin)
gtkTextViewGetRightMargin(object)
gtkTextViewSetIndent(object, indent)
gtkTextViewGetIndent(object)
gtkTextViewSetTabs(object, tabs)
gtkTextViewGetTabs(object)
gtkTextViewSetAcceptsTab(object, accepts.tab)
gtkTextViewGetAcceptsTab(object)
gtkTextViewGetDefaultAttributes(object)
gtkTextView(buffer = NULL, show = TRUE)
gtkTextChildAnchor()

Hierarchy

1
2
3
4
5
6
7
8
GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkTextView
GObject
   +----GtkTextChildAnchor

Interfaces

GtkTextView implements AtkImplementorIface and GtkBuildable.

Detailed 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.

Structures

GtkTextView

undocumented

GtkTextChildAnchor

A GtkTextChildAnchor is a spot in the buffer where child widgets can be "anchored" (inserted inline, as if they were characters). The anchor can have multiple widgets anchored, to allow for multiple views.

Convenient Construction

gtkTextView is the result of collapsing the constructors of GtkTextView (gtkTextViewNew, gtkTextViewNewWithBuffer) and accepts a subset of its arguments matching the required arguments of one of its delegate constructors. gtkTextChildAnchor is the equivalent of gtkTextChildAnchorNew.

Enums and Flags

GtkTextWindowType

undocumented

private

undocumented

widget

undocumented

text

undocumented

left

undocumented

right

undocumented

top

undocumented

bottom

undocumented

Signals

backspace(text.view, user.data)

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.

text.view

the object which received the signal

user.data

user data set when the signal handler was connected.

copy-clipboard(text.view, user.data)

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.

text.view

the object which received the signal

user.data

user data set when the signal handler was connected.

cut-clipboard(text.view, user.data)

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.

text.view

the object which received the signal

user.data

user data set when the signal handler was connected.

delete-from-cursor(text.view, type, count, user.data)

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.

text.view

the object which received the signal

type

the granularity of the deletion, as a GtkDeleteType

count

the number of type units to delete

user.data

user data set when the signal handler was connected.

insert-at-cursor(text.view, string, user.data)

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.

text.view

the object which received the signal

string

the string to insert

user.data

user data set when the signal handler was connected.

move-cursor(text.view, step, count, extend.selection, user.data)

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 gSignalEmitByName() 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.

text.view

the object which received the signal

step

the granularity of the move, as a GtkMovementStep

count

the number of step units to move

extend.selection

TRUE if the move should extend the selection

user.data

user data set when the signal handler was connected.

move-viewport(text.view, step, count, user.data)

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.

text.view

the object which received the signal

step

the granularity of the move, as a GtkMovementStep

count

the number of step units to move

user.data

user data set when the signal handler was connected.

page-horizontally(text.view, count, extend.selection, user.data)

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.

text.view

the object which received the signal

count

the number of step units to move

extend.selection

TRUE if the move should extend the selection

user.data

user data set when the signal handler was connected.

paste-clipboard(text.view, user.data)

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.

text.view

the object which received the signal

user.data

user data set when the signal handler was connected.

populate-popup(entry, menu, user.data)

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.

entry

The text view on which the signal is emitted

menu

the menu that is being populated

user.data

user data set when the signal handler was connected.

preedit-changed(text.view, preedit, user.data)

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

text.view

the object which received the signal

preedit

the current preedit string

user.data

user data set when the signal handler was connected.

select-all(text.view, select, user.data)

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.

text.view

the object which received the signal

select

TRUE to select, FALSE to unselect

user.data

user data set when the signal handler was connected.

set-anchor(text.view, user.data)

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.

text.view

the object which received the signal

user.data

user data set when the signal handler was connected.

set-scroll-adjustments(horizontal, vertical, user.data)

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.

horizontal

the horizontal GtkAdjustment

vertical

the vertical GtkAdjustment

user.data

user data set when the signal handler was connected.

toggle-cursor-visible(text.view, user.data)

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.

text.view

the object which received the signal

user.data

user data set when the signal handler was connected.

toggle-overwrite(text.view, user.data)

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.

text.view

the object which received the signal

user.data

user data set when the signal handler was connected.

Properties

accepts-tab [logical : Read / Write]

Whether Tab will result in a tab character being entered. Default value: TRUE

buffer [GtkTextBuffer : * : Read / Write]

The buffer which is displayed.

cursor-visible [logical : Read / Write]

If the insertion cursor is shown. Default value: TRUE

editable [logical : Read / Write]

Whether the text can be modified by the user. Default value: TRUE

im-module [character : * : Read / Write]

Which IM (input method) module should be used for this entry. See GtkIMContext.

Setting this to a non-NULL value overrides the system-wide IM module setting. See the GtkSettings "gtk-im-module" property. Default value: NULL Since 2.16

indent [integer : Read / Write]

Amount to indent the paragraph, in pixels. Default value: 0

justification [GtkJustification : Read / Write]

Left, right, or center justification. Default value: GTK_JUSTIFY_LEFT

left-margin [integer : Read / Write]

Width of the left margin in pixels. Allowed values: >= 0 Default value: 0

overwrite [logical : Read / Write]

Whether entered text overwrites existing contents. Default value: FALSE

pixels-above-lines [integer : Read / Write]

Pixels of blank space above paragraphs. Allowed values: >= 0 Default value: 0

pixels-below-lines [integer : Read / Write]

Pixels of blank space below paragraphs. Allowed values: >= 0 Default value: 0

pixels-inside-wrap [integer : Read / Write]

Pixels of blank space between wrapped lines in a paragraph. Allowed values: >= 0 Default value: 0

right-margin [integer : Read / Write]

Width of the right margin in pixels. Allowed values: >= 0 Default value: 0

tabs [PangoTabArray : * : Read / Write]

Custom tabs for this text.

wrap-mode [GtkWrapMode : Read / Write]

Whether to wrap lines never, at word boundaries, or at character boundaries. Default value: GTK_WRAP_NONE

Style Properties

error-underline-color [GdkColor : * : Read]

Color with which to draw error-indication underlines.

Author(s)

Derived by RGtkGen from GTK+ documentation

References

http://library.gnome.org/devel//gtk/GtkTextView.html

See Also

GtkTextBuffer GtkTextIter

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.