GtkTextBuffer {RGtk2} | R Documentation

## GtkTextBuffer

### Description

Stores attributed text for display in a GtkTextView

### Methods and Functions

`gtkTextBufferNew(table = NULL)`
`gtkTextBufferGetLineCount(object)`
`gtkTextBufferGetCharCount(object)`
`gtkTextBufferGetTagTable(object)`
`gtkTextBufferInsert(object, iter, text, len = -1)`
`gtkTextBufferInsertAtCursor(object, text, len = -1)`
`gtkTextBufferInsertInteractive(object, iter, text, default.editable)`
`gtkTextBufferInsertInteractiveAtCursor(object, text, default.editable)`
`gtkTextBufferInsertRange(object, iter, start, end)`
`gtkTextBufferInsertRangeInteractive(object, iter, start, end, default.editable)`
`gtkTextBufferInsertWithTags(object, iter, text, ...)`
`gtkTextBufferInsertWithTagsByName(object, iter, text, ...)`
`gtkTextBufferDelete(object, start, end)`
`gtkTextBufferDeleteInteractive(object, start.iter, end.iter, default.editable)`
`gtkTextBufferBackspace(object, iter, interactive, default.editable)`
`gtkTextBufferSetText(object, text, len = -1)`
`gtkTextBufferGetText(object, start, end, include.hidden.chars = TRUE)`
`gtkTextBufferGetSlice(object, start, end, include.hidden.chars = TRUE)`
`gtkTextBufferInsertPixbuf(object, iter, pixbuf)`
`gtkTextBufferInsertChildAnchor(object, iter, anchor)`
`gtkTextBufferCreateChildAnchor(object, iter)`
`gtkTextBufferCreateMark(object, mark.name = NULL, where, left.gravity = FALSE)`
`gtkTextBufferMoveMark(object, mark, where)`
`gtkTextBufferMoveMarkByName(object, name, where)`
`gtkTextBufferAddMark(object, mark, where)`
`gtkTextBufferDeleteMark(object, mark)`
`gtkTextBufferDeleteMarkByName(object, name)`
`gtkTextBufferGetMark(object, name)`
`gtkTextBufferGetInsert(object)`
`gtkTextBufferGetSelectionBound(object)`
`gtkTextBufferGetHasSelection(object)`
`gtkTextBufferPlaceCursor(object, where)`
`gtkTextBufferSelectRange(object, ins, bound)`
`gtkTextBufferApplyTag(object, tag, start, end)`
`gtkTextBufferRemoveTag(object, tag, start, end)`
`gtkTextBufferApplyTagByName(object, name, start, end)`
`gtkTextBufferRemoveTagByName(object, name, start, end)`
`gtkTextBufferRemoveAllTags(object, start, end)`
`gtkTextBufferCreateTag(object, tag.name, ...)`
`gtkTextBufferGetIterAtLineOffset(object, line.number, char.offset)`
`gtkTextBufferGetIterAtOffset(object, char.offset)`
`gtkTextBufferGetIterAtLine(object, line.number)`
`gtkTextBufferGetIterAtLineIndex(object, line.number, byte.index)`
`gtkTextBufferGetIterAtMark(object, mark)`
`gtkTextBufferGetIterAtChildAnchor(object, anchor)`
`gtkTextBufferGetStartIter(object)`
`gtkTextBufferGetEndIter(object)`
`gtkTextBufferGetBounds(object)`
`gtkTextBufferGetModified(object)`
`gtkTextBufferSetModified(object, setting)`
`gtkTextBufferDeleteSelection(object, interactive, default.editable)`
`gtkTextBufferPasteClipboard(object, clipboard, override.location = NULL, default.editable)`
`gtkTextBufferCopyClipboard(object, clipboard)`
`gtkTextBufferCutClipboard(object, clipboard, default.editable)`
`gtkTextBufferGetSelectionBounds(object)`
`gtkTextBufferBeginUserAction(object)`
`gtkTextBufferEndUserAction(object)`
`gtkTextBufferAddSelectionClipboard(object, clipboard)`
`gtkTextBufferRemoveSelectionClipboard(object, clipboard)`
`gtkTextBufferDeserialize(object, content.buffer, format, iter, data, .errwarn = TRUE)`
`gtkTextBufferDeserializeGetCanCreateTags(object, format)`
`gtkTextBufferDeserializeSetCanCreateTags(object, format, can.create.tags)`
`gtkTextBufferGetCopyTargetList(object)`
`gtkTextBufferGetDeserializeFormats(object)`
`gtkTextBufferGetPasteTargetList(object)`
`gtkTextBufferGetSerializeFormats(object)`
`gtkTextBufferRegisterDeserializeFormat(object, mime.type, fun, user.data)`
`gtkTextBufferRegisterDeserializeTagset(object, tagset.name = NULL)`
`gtkTextBufferRegisterSerializeFormat(object, mime.type, fun, user.data)`
`gtkTextBufferRegisterSerializeTagset(object, tagset.name = NULL)`
`gtkTextBufferSerialize(object, content.buffer, format, start, end)`
`gtkTextBufferUnregisterDeserializeFormat(object, format)`
`gtkTextBufferUnregisterSerializeFormat(object, format)`
`gtkTextBuffer(table = NULL)`

### Hierarchy

    GObject
       +----GtkTextBuffer

### 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

`GtkTextBuffer`

  undocumented

  `tagTable`

    [`GtkTextTagTable`]

### Convenient Construction

`gtkTextBuffer` is the equivalent of `gtkTextBufferNew`.

### Enums and Flags

`GtkTextBufferTargetInfo`

  undocumented

  `buffer-contents`

    undocumented

  `rich-text`

    undocumented

  `text`

    undocumented

### User Functions

`GtkTextBufferDeserializeFunc(register.buffer, content.buffer, iter, data, length, create.tags, user.data, error)`

  A function that is called to deserialize rich text that has been serialized with `gtkTextBufferSerialize`, and insert it at `iter`.

  `register.buffer`

    the `GtkTextBuffer` the format is registered with

  `content.buffer`

    the `GtkTextBuffer` to deserialize into

  `iter`

    insertion point for the deserialized text

  `data`

    data to deserialize

  `length`

    length of `data`

  `create.tags`

    `TRUE` if deserializing may create tags

  `user.data`

    user data that was specified when registering the format

  `error`

    return location for a `GError`

  Returns: [logical] `TRUE` on success, `FALSE` otherwise

`GtkTextBufferSerializeFunc(register.buffer, content.buffer, start, end, length, user.data)`

  A function that is called to serialize the content of a text buffer. It must return the serialized form of the content.

  `register.buffer`

    the `GtkTextBuffer` for which the format is registered

  `content.buffer`

    the `GtkTextsBuffer` to serialize

  `start`

    start of the block of text to serialize

  `end`

    end of the block of text to serialize

  `length`

    Return location for the length of the serialized data

  `user.data`

    user data that was specified when registering the format

  Returns: [raw] a newly-allocated list of guint8 which contains the serialized data, or `NULL` if an error occurred

### Signals

`apply-tag(textbuffer, tag, start, end, user.data)`

  The ::apply-tag signal is emitted to apply a tag to a range of text in a `GtkTextBuffer`. Applying actually occurs in the default handler.

  Note that if your handler runs before the default handler it must not invalidate the `start` and `end` iters (or has to revalidate them).

  See also: `gtkTextBufferApplyTag`, `gtkTextBufferInsertWithTags`, `gtkTextBufferInsertRange`.

  `textbuffer`

    the object which received the signal

  `tag`

    the applied tag

  `start`

    the start of the range the tag is applied to

  `end`

    the end of the range the tag is applied to

  `user.data`

    user data set when the signal handler was connected.

`begin-user-action(textbuffer, user.data)`

  The ::begin-user-action signal is emitted at the beginning of a single user-visible operation on a `GtkTextBuffer`.

  See also: `gtkTextBufferBeginUserAction`, `gtkTextBufferInsertInteractive`, `gtkTextBufferInsertRangeInteractive`, `gtkTextBufferDeleteInteractive`, `gtkTextBufferBackspace`, `gtkTextBufferDeleteSelection`.

  `textbuffer`

    the object which received the signal

  `user.data`

    user data set when the signal handler was connected.

`changed(textbuffer, user.data)`

  The ::changed signal is emitted when the content of a `GtkTextBuffer` has changed.

  `textbuffer`

    the object which received the signal

  `user.data`

    user data set when the signal handler was connected.

`delete-range(textbuffer, start, end, user.data)`

  The ::delete-range signal is emitted to delete a range from a `GtkTextBuffer`.

  Note that if your handler runs before the default handler it must not invalidate the `start` and `end` iters (or has to revalidate them). The default signal handler revalidates the `start` and `end` iters to both point point to the location where text was deleted. Handlers which run after the default handler (see `gSignalConnectAfter()`) do not have access to the deleted text.

  See also: `gtkTextBufferDelete`.

  `textbuffer`

    the object which received the signal

  `start`

    the start of the range to be deleted

  `end`

    the end of the range to be deleted

  `user.data`

    user data set when the signal handler was connected.

`end-user-action(textbuffer, user.data)`

  The ::end-user-action signal is emitted at the end of a single user-visible operation on the `GtkTextBuffer`.

  See also: `gtkTextBufferEndUserAction`, `gtkTextBufferInsertInteractive`, `gtkTextBufferInsertRangeInteractive`, `gtkTextBufferDeleteInteractive`, `gtkTextBufferBackspace`, `gtkTextBufferDeleteSelection`, `gtkTextBufferBackspace`.

  `textbuffer`

    the object which received the signal

  `user.data`

    user data set when the signal handler was connected.

`insert-child-anchor(textbuffer, location, anchor, user.data)`

  The ::insert-child-anchor signal is emitted to insert a `GtkTextChildAnchor` in a `GtkTextBuffer`. Insertion actually occurs in the default handler.

  Note that if your handler runs before the default handler it must not invalidate the `location` iter (or has to revalidate it). The default signal handler revalidates it to be placed after the inserted `anchor`.

  See also: `gtkTextBufferInsertChildAnchor`.

  `textbuffer`

    the object which received the signal

  `location`

    position to insert `anchor` in `textbuffer`

  `anchor`

    the `GtkTextChildAnchor` to be inserted

  `user.data`

    user data set when the signal handler was connected.

`insert-pixbuf(textbuffer, location, pixbuf, user.data)`

  The ::insert-pixbuf signal is emitted to insert a `GdkPixbuf` in a `GtkTextBuffer`. Insertion actually occurs in the default handler.

  Note that if your handler runs before the default handler it must not invalidate the `location` iter (or has to revalidate it). The default signal handler revalidates it to be placed after the inserted `pixbuf`.

  See also: `gtkTextBufferInsertPixbuf`.

  `textbuffer`

    the object which received the signal

  `location`

    position to insert `pixbuf` in `textbuffer`

  `pixbuf`

    the `GdkPixbuf` to be inserted

  `user.data`

    user data set when the signal handler was connected.

`insert-text(textbuffer, location, text, len, user.data)`

  The ::insert-text signal is emitted to insert text in a `GtkTextBuffer`. Insertion actually occurs in the default handler.

  Note that if your handler runs before the default handler it must not invalidate the `location` iter (or has to revalidate it). The default signal handler revalidates it to point to the end of the inserted text.

  See also: `gtkTextBufferInsert`, `gtkTextBufferInsertRange`.

  `textbuffer`

    the object which received the signal

  `location`

    position to insert `text` in `textbuffer`

  `text`

    the UTF-8 text to be inserted

  `len`

    length of the inserted text in bytes

  `user.data`

    user data set when the signal handler was connected.

`mark-deleted(textbuffer, mark, user.data)`

  The ::mark-deleted signal is emitted as notification after a `GtkTextMark` is deleted.

  See also: `gtkTextBufferDeleteMark`.

  `textbuffer`

    the object which received the signal

  `mark`

    The mark that was deleted

  `user.data`

    user data set when the signal handler was connected.

`mark-set(textbuffer, location, mark, user.data)`

  The ::mark-set signal is emitted as notification after a `GtkTextMark` is set.

  See also: `gtkTextBufferCreateMark`, `gtkTextBufferMoveMark`.

  `textbuffer`

    the object which received the signal

  `location`

    The location of `mark` in `textbuffer`

  `mark`

    The mark that is set

  `user.data`

    user data set when the signal handler was connected.

`modified-changed(textbuffer, user.data)`

  The ::modified-changed signal is emitted when the modified bit of a `GtkTextBuffer` flips.

  See also: `gtkTextBufferSetModified`.

  `textbuffer`

    the object which received the signal

  `user.data`

    user data set when the signal handler was connected.

`paste-done(textbuffer, user.data)`

  The paste-done signal is emitted after paste operation has been completed. This is useful to properly scroll the view to the end of the pasted text. See `gtkTextBufferPasteClipboard` for more details. Since 2.16

  `textbuffer`

    the object which received the signal

  `user.data`

    user data set when the signal handler was connected.

`remove-tag(textbuffer, tag, start, end, user.data)`

  The ::remove-tag signal is emitted to remove all occurrences of `tag` from a range of text in a `GtkTextBuffer`. Removal actually occurs in the default handler.

  Note that if your handler runs before the default handler it must not invalidate the `start` and `end` iters (or has to revalidate them).

  See also: `gtkTextBufferRemoveTag`.

  `textbuffer`

    the object which received the signal

  `tag`

    the tag to be removed

  `start`

    the start of the range the tag is removed from

  `end`

    the end of the range the tag is removed from

  `user.data`

    user data set when the signal handler was connected.

### Properties

`copy-target-list` [`GtkTargetList` : * : Read]

  The list of targets this buffer supports for clipboard copying and as DND source. Since 2.10

`cursor-position` [integer : Read]

  The position of the insert mark (as offset from the beginning of the buffer). It is useful for getting notified when the cursor moves. Allowed values: >= 0 Default value: 0 Since 2.10

`has-selection` [logical : Read]

  Whether the buffer has some text currently selected. Default value: FALSE Since 2.10

`paste-target-list` [`GtkTargetList` : * : Read]

  The list of targets this buffer supports for clipboard pasting and as DND destination. Since 2.10

`tag-table` [`GtkTextTagTable` : * : Read / Write / Construct Only]

  Text Tag Table.

`text` [character : * : Read / Write]

  The text content of the buffer. Without child widgets and images, see `gtkTextBufferGetText` for more information. Default value: "" Since 2.8

### Author(s)

Derived by RGtkGen from GTK+ documentation

### References

https://developer.gnome.org/gtk2/stable/GtkTextBuffer.html

### See Also

`GtkTextView` `GtkTextIter` `GtkTextMark`

[Package RGtk2 version 2.20.36.3 Index]