![]() |
![]() |
Text in a buffer can be marked with tags. A Gtk::TextBuffer::Tag is an attribute that can be applied to some range of text. For example, a tag might be called "bold" and make the text inside the tag bold. However, the tag concept is more general than that; tags don't have to affect appearance. They can instead affect the behavior of mouse and key presses, "lock" a range of text so the user can't edit it, or countless other things. A tag is represented by a Gtk::TextBuffer::Tag object. One Gtk::TextBuffer::Tag can be applied to any number of text ranges in any number of Gtk::TextBuffers.
Each tag is stored in a Gtk::TextBuffer::TagTable. A tag table defines a set of tags that can be used together. Each buffer has one tag table associated with it; only tags from that tag table can be used with the buffer. A single tag table can be shared between multiple buffers, however.
Most text manipulation is accomplished with iterators, represented by an iterator. The iterator can be used to navigate over characters, words, lines, and sentences.
But iterators can't be used to preserve positions across buffer modifications. To preserve a position, the Gtk::TextBuffer::Mark object is ideal. There are two marks built-in to GtkTextBuffer; these are named "insert" and "selection_bound" and refer to the insertion point and the boundary of the selection which is not the insertion point. If no text is selected, these two marks will be in the same position. You can manipulate what is selected and where the cursor appears by moving these marks around.
Text buffers always contain at least one line, but may be empty (that is, buffers can contain zero characters). The last line in the text buffer never ends in a line separator (such as newline); the other lines in the buffer always end in a line separator. Line separators count as characters when computing character counts and character offsets. Note that some Unicode line separators are represented with multiple bytes in UTF-8, and the two-character sequence "\r\n" is also considered a line separator.
Public Types | |
typedef TextChildAnchor | ChildAnchor |
typedef TextIter | iterator |
typedef TextMark | Mark |
typedef TextTag | Tag |
typedef TextTagTable | TagTable |
Public Member Functions | |
void | add_selection_clipboard (const Glib::RefPtr<Clipboard>& clipboard) |
Adds clipboard to the list of clipboards in which the selection contents of buffer are available. | |
void | apply_tag (const Glib::RefPtr<Tag>& tag, const iterator& start, const iterator& end) |
Emits the "apply_tag" signal on buffer . | |
void | apply_tag_by_name (const Glib::ustring& name, const iterator& start, const iterator& end) |
Calls Gtk::TextTagTable::lookup() on the buffer's tag table to get a Gtk::TextTag, then calls apply_tag(). | |
void | assign (const char* text_begin, const char* text_end) |
void | assign (const Glib::ustring& text) |
iterator | backspace (const iterator& iter, bool interactive=true, bool default_editable=true) |
Performs the appropriate action as if the user hit the delete key with the cursor at the position specified by iter. | |
iterator | begin () |
void | begin_user_action () |
Called to indicate that the buffer operations between here and a call to end_user_action() are part of a single user-visible operation. | |
void | copy_clipboard (const Glib::RefPtr<Clipboard>& clipboard) |
Copies the currently-selected text to a clipboard. | |
Glib::RefPtr<ChildAnchor> | create_child_anchor (const iterator& pos) |
Glib::RefPtr<Mark> | create_mark (const iterator& where, bool left_gravity=true) |
Creates an anonymous mark at position where. | |
Glib::RefPtr<TextBuffer::Mark> | create_mark (const Glib::ustring& mark_name, const iterator& where, bool left_gravity=true) |
Creates a mark at position where . | |
Glib::RefPtr<Tag> | create_tag () |
Creates an anoymous tag and adds it to the tag table for buffer. | |
Glib::RefPtr<Tag> | create_tag (const Glib::ustring& tag_name) |
Creates a tag and adds it to the tag table for buffer. | |
void | cut_clipboard (const Glib::RefPtr<Clipboard>& clipboard, bool default_editable=true) |
Copies the currently-selected text to a clipboard, then deletes said text if it's editable. | |
void | delete_mark (const Glib::RefPtr<Mark>& mark) |
Deletes mark , so that it's no longer located anywhere in the buffer. | |
void | delete_mark_by_name (const Glib::ustring& name) |
Deletes the mark named name ; the mark must exist. | |
iterator | end () |
void | end_user_action () |
Should be paired with a call to begin_user_action(). | |
iterator | erase (const iterator& range_begin, const iterator& range_end) |
std::pair<iterator, bool> | erase_interactive (const iterator& range_begin, const iterator& range_end, bool default_editable=true) |
bool | erase_selection (bool interactive=true, bool default_editable=true) |
Deletes the range between the "insert" and "selection_bound" marks, that is, the currently-selected text. | |
void | get_bounds (iterator& range_begin, iterator& range_end) |
int | get_char_count () const |
Gets the number of characters in the buffer; note that characters and bytes are not the same, you can't e.g. expect the contents of the buffer in string form to be this many bytes long. | |
bool | get_has_selection () const |
Glib::RefPtr<TextBuffer::Mark> | get_insert () |
Returns the mark that represents the cursor (insertion point). | |
iterator | get_iter_at_child_anchor (const Glib::RefPtr<ChildAnchor>& anchor) |
Get the current position of an anchor. | |
iterator | get_iter_at_line (int line_number) |
iterator | get_iter_at_line_index (int line_number, int byte_index) |
iterator | get_iter_at_line_offset (int line_number, int char_offset) |
iterator | get_iter_at_mark (const Glib::RefPtr<Mark>& mark) |
Get the current position of a mark. | |
iterator | get_iter_at_offset (int char_offset) |
int | get_line_count () const |
Obtains the number of lines in the buffer. | |
Glib::RefPtr<const TextBuffer::Mark> | get_mark (const Glib::ustring& name) const |
Returns the mark named name in buffer buffer , or 0 if no such mark exists in the buffer. | |
Glib::RefPtr<TextBuffer::Mark> | get_mark (const Glib::ustring& name) |
Returns the mark named name in buffer buffer , or 0 if no such mark exists in the buffer. | |
bool | get_modified () const |
Indicates whether the buffer has been modified since the last call to set_modified() set the modification flag to false . | |
Glib::RefPtr<TextBuffer::Mark> | get_selection_bound () |
Returns the mark that represents the selection bound. | |
bool | get_selection_bounds (iterator& start, iterator& end) const |
Returns true if some text is selected; places the bounds of the selection in start and end (if the selection has length 0, then start and end are filled in with the same value). | |
Glib::ustring | get_slice (const iterator& start, const iterator& end, bool include_hidden_chars=true) const |
Returns the text in the range [ start , end ). | |
Glib::ustring | get_slice (const iterator& start, const iterator& end, bool include_hidden_chars=true) |
Returns the text in the range [ start , end ). | |
Glib::RefPtr<const TextBuffer::TagTable> | get_tag_table () const |
Get the Gtk::TextTagTable associated with this buffer. | |
Glib::RefPtr<TextBuffer::TagTable> | get_tag_table () |
Get the Gtk::TextTagTable associated with this buffer. | |
Glib::ustring | get_text (bool include_hidden_chars=true) const |
Returns all the text in the buffer. | |
Glib::ustring | get_text (bool include_hidden_chars=true) |
Glib::ustring | get_text (const iterator& start, const iterator& end, bool include_hidden_chars=true) const |
Returns the text in the range [ start , end ). | |
Glib::ustring | get_text (const iterator& start, const iterator& end, bool include_hidden_chars=true) |
Returns the text in the range [ start , end ). | |
const GtkTextBuffer* | gobj () const |
Provides access to the underlying C GObject. | |
GtkTextBuffer* | gobj () |
Provides access to the underlying C GObject. | |
GtkTextBuffer* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
iterator | insert (const iterator& pos, const iterator& range_begin, const iterator& range_end) |
Copies text, tags, and pixbufs between range_begin and range_end (the order of range_begin and range_begin doesn't matter) and inserts the copy at pos. | |
iterator | insert (const iterator& pos, const char* text_begin, const char* text_end) |
Inserts text at position pos. | |
iterator | insert (const iterator& pos, const Glib::ustring& text) |
Inserts text at position pos. | |
void | insert_at_cursor (const char* text_begin, const char* text_end) |
Inserts text, using the current cursor position as the insertion point. | |
void | insert_at_cursor (const Glib::ustring& text) |
Inserts text, using the current cursor position as the insertion point. | |
iterator | insert_child_anchor (const iterator& pos, const Glib::RefPtr<ChildAnchor>& anchor) |
std::pair<iterator, bool> | insert_interactive (const iterator& pos, const iterator& range_begin, const iterator& range_end, bool default_editable=true) |
Same as insert_range(), but does nothing if the insertion point isn't editable. | |
std::pair<iterator, bool> | insert_interactive (const iterator& pos, const char* text_begin, const char* text_end, bool default_editable=true) |
Like insert(), but the insertion will not occur if pos is at a non-editable location in the buffer. | |
std::pair<iterator, bool> | insert_interactive (const iterator& pos, const Glib::ustring& text, bool default_editable=true) |
Like insert(), but the insertion will not occur if iter is at a non-editable location in the buffer. | |
bool | insert_interactive_at_cursor (const char* text_begin, const char* text_end, bool default_editable=true) |
Calls insert_interactive() at the cursor position. | |
bool | insert_interactive_at_cursor (const Glib::ustring& text, bool default_editable=true) |
Calls insert_interactive() at the cursor position. | |
iterator | insert_pixbuf (const iterator& pos, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf) |
iterator | insert_with_tag (const iterator& pos, const char* text_begin, const char* text_end, const Glib::ustring& tag_name) |
iterator | insert_with_tag (const iterator& pos, const Glib::ustring& text, const Glib::ustring& tag_name) |
iterator | insert_with_tag (const iterator& pos, const char* text_begin, const char* text_end, const Glib::RefPtr<Tag>& tag) |
iterator | insert_with_tag (const iterator& pos, const Glib::ustring& text, const Glib::RefPtr<Tag>& tag) |
iterator | insert_with_tags (const iterator& pos, const char* text_begin, const char* text_end, const Glib::ArrayHandle<Glib::RefPtr<Tag>>& tags) |
Inserts text into buffer at pos, applying the list of tags to the newly-inserted text. | |
iterator | insert_with_tags (const iterator& pos, const Glib::ustring& text, const Glib::ArrayHandle<Glib::RefPtr<Tag>>& tags) |
Inserts text into buffer at pos, applying the list of tags to the newly-inserted text. | |
iterator | insert_with_tags_by_name (const iterator& pos, const char* text_begin, const char* text_end, const Glib::StringArrayHandle& tag_names) |
Equivalent to calling insert(), then apply_tag() on the inserted text; This is just a convenience function. | |
iterator | insert_with_tags_by_name (const iterator& pos, const Glib::ustring& text, const Glib::StringArrayHandle& tag_names) |
Inserts text into buffer at pos, applying the list of tags to the newly-inserted text. | |
void | move_mark (const Glib::RefPtr<Mark>& mark, const iterator& where) |
Moves mark to the new location where . | |
void | move_mark_by_name (const Glib::ustring& name, const iterator& where) |
Moves the mark named name (which must exist) to location where . | |
void | paste_clipboard (const Glib::RefPtr<Clipboard>& clipboard, bool default_editable=true) |
void | paste_clipboard (const Glib::RefPtr<Clipboard>& clipboard, const iterator& override_location, bool default_editable=true) |
void | place_cursor (const iterator& where) |
This function moves the "insert" and "selection_bound" marks simultaneously. | |
Glib::PropertyProxy_ReadOnly< bool > | property_has_selection () const |
Whether the buffer has some text currently selected. | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_text () const |
Current text of the buffer. | |
Glib::PropertyProxy<Glib::ustring> | property_text () |
Current text of the buffer. | |
void | remove_all_tags (const iterator& start, const iterator& end) |
Removes all tags in the range between start and end . | |
void | remove_selection_clipboard (const Glib::RefPtr<Clipboard>& clipboard) |
Removes a Gtk::Clipboard added with add_selection_clipboard(). | |
void | remove_tag (const Glib::RefPtr<Tag>& tag, const iterator& start, const iterator& end) |
Emits the "remove_tag" signal. | |
void | remove_tag_by_name (const Glib::ustring& name, const iterator& start, const iterator& end) |
Calls Gtk::TextTagTable::lookup() on the buffer's tag table to get a Gtk::TextTag, then calls remove_tag(). | |
void | select_range (const iterator& ins, const iterator& bound) |
This function moves the "insert" and "selection_bound" marks simultaneously. | |
void | set_modified (bool setting=true) |
Used to keep track of whether the buffer has been modified since the last time it was saved. | |
void | set_text (const char* text_begin, const char* text_end) |
Removes the current contents of the buffer, and inserts text instead. | |
void | set_text (const Glib::ustring& text) |
Removes the current contents of the buffer, and inserts text instead. | |
Glib::SignalProxy3< void, const Glib::RefPtr<TextBuffer::Tag>&, const TextBuffer::iterator&, const TextBuffer::iterator& > | signal_apply_tag () |
Glib::SignalProxy0<void> | signal_begin_user_action () |
Glib::SignalProxy0<void> | signal_changed () |
Glib::SignalProxy0<void> | signal_end_user_action () |
Glib::SignalProxy2< void, const TextBuffer::iterator&, const TextBuffer::iterator& > | signal_erase () |
The delete_range signal is emitted to delete a range from a TextBuffer. | |
Glib::SignalProxy3< void, const TextBuffer::iterator&, const Glib::ustring&, int > | signal_insert () |
Glib::SignalProxy2< void, const TextBuffer::iterator&, const Glib::RefPtr<ChildAnchor >&> | signal_insert_child_anchor () |
Glib::SignalProxy2< void, const TextBuffer::iterator&, const Glib::RefPtr<Gdk::Pixbuf >&> | signal_insert_pixbuf () |
Glib::SignalProxy1< void, const Glib::RefPtr<TextBuffer::Mark >&> | signal_mark_deleted () |
Glib::SignalProxy2< void, const TextBuffer::iterator&, const Glib::RefPtr<TextBuffer::Mark >&> | signal_mark_set () |
Glib::SignalProxy0<void> | signal_modified_changed () |
Glib::SignalProxy3< void, const Glib::RefPtr<TextBuffer::Tag>&, const TextBuffer::iterator&, const TextBuffer::iterator& > | signal_remove_tag () |
int | size () const |
See get_char_count(). | |
virtual | ~TextBuffer () |
Static Public Member Functions | |
static Glib::RefPtr<TextBuffer> | create (const Glib::RefPtr<TagTable>& tag_table) |
static Glib::RefPtr<TextBuffer> | create () |
Protected Member Functions | |
virtual void | on_apply_tag (const Glib::RefPtr<TextBuffer::Tag>& tag, const TextBuffer::iterator& range_begin, const TextBuffer::iterator& range_end) |
virtual void | on_begin_user_action () |
virtual void | on_changed () |
virtual void | on_end_user_action () |
virtual void | on_erase (const TextBuffer::iterator& start, const TextBuffer::iterator& end) |
virtual void | on_insert (const TextBuffer::iterator& pos, const Glib::ustring& text, int bytes) |
virtual void | on_insert_child_anchor (const TextBuffer::iterator& pos, const Glib::RefPtr<ChildAnchor>& anchor) |
virtual void | on_insert_pixbuf (const TextBuffer::iterator& pos, const Glib::RefPtr<Gdk::Pixbuf>& pixbuf) |
virtual void | on_mark_deleted (const Glib::RefPtr<TextBuffer::Mark>& mark) |
virtual void | on_mark_set (const TextBuffer::iterator& location, const Glib::RefPtr<TextBuffer::Mark>& mark) |
virtual void | on_modified_changed () |
virtual void | on_remove_tag (const Glib::RefPtr<TextBuffer::Tag>& tag, const TextBuffer::iterator& range_begin, const TextBuffer::iterator& range_end) |
TextBuffer (const Glib::RefPtr<TagTable>& tag_table) | |
TextBuffer () | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Gtk::TextBuffer> | wrap (GtkTextBuffer* object, bool take_copy=false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Adds clipboard to the list of clipboards in which the selection contents of buffer are available. In most cases, clipboard will be the Gtk::Clipboard of type Gdk::SELECTION_PRIMARY for a view of buffer .
|
|
Emits the "apply_tag" signal on buffer . The default handler for the signal applies tag to the given range. start and end do not have to be in order.
|
|
Calls Gtk::TextTagTable::lookup() on the buffer's tag table to get a Gtk::TextTag, then calls apply_tag().
|
|
|
|
|
|
Performs the appropriate action as if the user hit the delete key with the cursor at the position specified by iter. In the normal case a single character will be deleted, but when combining accents are involved, more than one character can be deleted, and when precomposed character and accent combinations are involved, less than one character will be deleted. Because the buffer is modified, all outstanding iterators become invalid after calling this method; however, this method returns a valid iterator that points to the location where text was deleted.
|
|
|
|
Called to indicate that the buffer operations between here and a call to end_user_action() are part of a single user-visible operation. The operations between begin_user_action() and end_user_action() can then be grouped when creating an undo stack. Gtk::TextBuffer maintains a count of calls to begin_user_action() that have not been closed with a call to end_user_action(), and emits the "begin_user_action" and "end_user_action" signals only for the outermost pair of calls. This allows you to build user actions from other user actions. The "interactive" buffer mutation functions, such as insert_interactive(), automatically call begin/end user action around the buffer operations they perform, so there's no need to add extra calls if you user action consists solely of a single call to one of those functions. |
|
Copies the currently-selected text to a clipboard.
|
|
|
|
|
|
|
|
Creates an anonymous mark at position where.
If a mark has left gravity, and text is inserted at the mark's current location, the mark will be moved to the left of the newly-inserted text. If the mark has right gravity ( left_gravity = Emits the "mark_set" signal as notification of the mark's initial placement.
|
|
Creates a mark at position where .
The mark can be retrieved by name using get_mark(). If a mark has left gravity, and text is inserted at the mark's current location, the mark will be moved to the left of the newly-inserted text. If the mark has right gravity ( left_gravity = Emits the "mark_set" signal as notification of the mark's initial placement.
|
|
Creates an anoymous tag and adds it to the tag table for buffer. Equivalent to calling Gtk::TextBuffer::Tag::create() and then adding the tag to the buffer's tag table.
|
|
Creates a tag and adds it to the tag table for buffer. Equivalent to calling Gtk::TextBuffer::Tag::create() and then adding the tag to the buffer's tag table. A tag called tag_name must not already exist in the tag table for this buffer.
|
|
Copies the currently-selected text to a clipboard, then deletes said text if it's editable.
|
|
Deletes mark , so that it's no longer located anywhere in the buffer.
Removes the reference the buffer holds to the mark, so if you don't keep a Glib::RefPtr to the mark, it will be freed. Even if the mark isn't freed, most operations on mark become invalid. There is no way to undelete a mark. Gtk::TextMark::get_deleted() will return
|
|
Deletes the mark named name ; the mark must exist. See delete_mark() for details.
|
|
|
|
Should be paired with a call to begin_user_action(). See that function for a full explanation. |
|
|
|
|
|
Deletes the range between the "insert" and "selection_bound" marks, that is, the currently-selected text.
If interactive is
|
|
|
|
Gets the number of characters in the buffer; note that characters and bytes are not the same, you can't e.g. expect the contents of the buffer in string form to be this many bytes long. The character count is cached, so this function is very fast.
|
|
|
|
Returns the mark that represents the cursor (insertion point). Equivalent to calling get_mark() to get the mark named "insert", but very slightly more efficient, and involves less typing.
|
|
Get the current position of an anchor.
|
|
|
|
|
|
|
|
Get the current position of a mark.
|
|
|
|
Obtains the number of lines in the buffer. This value is cached, so the function is very fast.
|
|
Returns the mark named name in buffer buffer , or
|
|
Returns the mark named name in buffer buffer , or
|
|
Indicates whether the buffer has been modified since the last call to set_modified() set the modification flag to Used for example to enable a "save" function in a text editor.
|
|
Returns the mark that represents the selection bound. Equivalent to calling get_mark() to get the mark named "selection_bound", but very slightly more efficient, and involves less typing. The currently-selected text in buffer is the region between the "selection_bound" and "insert" marks. If "selection_bound" and "insert" are in the same place, then there is no current selection. get_selection_bounds() is another convenient function for handling the selection, if you just want to know whether there's a selection and what its bounds are.
|
|
Returns
start and end will be in ascending order. If start and end are
|
|
Returns the text in the range [ start , end ).
Excludes undisplayed text (text marked with tags that set the invisibility attribute) if include_hidden_chars is
|
|
Returns the text in the range [ start , end ).
Excludes undisplayed text (text marked with tags that set the invisibility attribute) if include_hidden_chars is
|
|
Get the Gtk::TextTagTable associated with this buffer.
|
|
Get the Gtk::TextTagTable associated with this buffer.
|
|
Returns all the text in the buffer.
Excludes undisplayed text (text marked with tags that set the invisibility attribute) if include_hidden_chars is
|
|
|
|
Returns the text in the range [ start , end ).
Excludes undisplayed text (text marked with tags that set the invisibility attribute) if include_hidden_chars is
|
|
Returns the text in the range [ start , end ).
Excludes undisplayed text (text marked with tags that set the invisibility attribute) if include_hidden_chars is
|
|
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase. |
|
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase. |
|
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
|
Copies text, tags, and pixbufs between range_begin and range_end (the order of range_begin and range_begin doesn't matter) and inserts the copy at pos. Used instead of simply getting/inserting text because it preserves images and tags. If range_begin and range_end are in a different buffer, the two buffers must share the same tag table. Implemented via emissions of the insert_text and apply_tag signals, so expect those.
|
|
Inserts text at position pos. Emits the "insert_text" signal; insertion actually occurs in the default handler for the signal. The pos iterator is invalidated when insertion occurs (because the buffer contents change).
|
|
Inserts text at position pos. Emits the "insert_text" signal; insertion actually occurs in the default handler for the signal. The pos iterator is invalidated when insertion occurs (because the buffer contents change).
|
|
Inserts text, using the current cursor position as the insertion point. Emits the "insert_text" signal; insertion actually occurs in the default handler for the signal.
|
|
Inserts text, using the current cursor position as the insertion point. Emits the "insert_text" signal; insertion actually occurs in the default handler for the signal.
|
|
|
|
Same as insert_range(), but does nothing if the insertion point isn't editable. The default_editable parameter indicates whether the text is editable at pos if no tags enclosing pos affect editability. Typically the result of Gtk::TextView::get_editable() is appropriate here.
|
|
Like insert(), but the insertion will not occur if pos is at a non-editable location in the buffer. Usually you want to prevent insertions at ineditable locations if the insertion results from a user action (is interactive). default_editable indicates the editability of text that doesn't have a tag affecting editability applied to it. Typically the result of Gtk::TextView::get_editable() is appropriate here.
|
|
Like insert(), but the insertion will not occur if iter is at a non-editable location in the buffer. Usually you want to prevent insertions at ineditable locations if the insertion results from a user action (is interactive). default_editable indicates the editability of text that doesn't have a tag affecting editability applied to it. Typically the result of Gtk::TextView::get_editable() is appropriate here.
|
|
Calls insert_interactive() at the cursor position. default_editable indicates the editability of text that doesn't have a tag affecting editability applied to it. Typically the result of Gtk::TextView::get_editable() is appropriate here.
|
|
Calls insert_interactive() at the cursor position. default_editable indicates the editability of text that doesn't have a tag affecting editability applied to it. Typically the result of Gtk::TextView::get_editable() is appropriate here.
|
|
|
|
|
|
|
|
|
|
|
|
Inserts text into buffer at pos, applying the list of tags to the newly-inserted text. Equivalent to calling insert(), then apply_tag() on the inserted text; This is just a convenience function.
|
|
Inserts text into buffer at pos, applying the list of tags to the newly-inserted text. Equivalent to calling insert(), then apply_tag() on the inserted text; This is just a convenience function.
|
|
Equivalent to calling insert(), then apply_tag() on the inserted text; This is just a convenience function.
|
|
Inserts text into buffer at pos, applying the list of tags to the newly-inserted text. Equivalent to calling insert(), then apply_tag() on the inserted text; This is just a convenience function.
|
|
Moves mark to the new location where . Emits the "mark_set" signal as notification of the move.
|
|
Moves the mark named name (which must exist) to location where . See move_mark() for details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This function moves the "insert" and "selection_bound" marks simultaneously. If you move them to the same place in two steps with move_mark(), you will temporarily select a region in between their old and new locations, which can be pretty inefficient since the temporarily-selected region will force stuff to be recalculated. This function moves them as a unit, which can be optimized.
|
|
Whether the buffer has some text currently selected. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Current text of the buffer. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Current text of the buffer. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Removes all tags in the range between start and end . Be careful with this function; it could remove tags added in code unrelated to the code you're currently writing. That is, using this function is probably a bad idea if you have two or more unrelated code sections that add tags.
|
|
Removes a Gtk::Clipboard added with add_selection_clipboard().
|
|
Emits the "remove_tag" signal. The default handler for the signal removes all occurrences of tag from the given range. start and end don't have to be in order.
|
|
Calls Gtk::TextTagTable::lookup() on the buffer's tag table to get a Gtk::TextTag, then calls remove_tag().
|
|
This function moves the "insert" and "selection_bound" marks simultaneously. If you move them in two steps with move_mark(), you will temporarily select a region in between their old and new locations, which can be pretty inefficient since the temporarily-selected region will force stuff to be recalculated. This function moves them as a unit, which can be optimized.
|
|
Used to keep track of whether the buffer has been modified since the last time it was saved.
Whenever the buffer is saved to disk, call gtk_text_buffer_set_modified ( buffer ,
|
|
Removes the current contents of the buffer, and inserts text instead.
|
|
Removes the current contents of the buffer, and inserts text instead.
|
|
|
|
|
|
|
|
|
|
The delete_range signal is emitted to delete a range from a TextBuffer. Note that your handler must not invalidate the start and end iters (or has to revalidate them), if it runs before the default handler. There is no need to keep the iters valid in handlers which run after the default handler but those don't have access to the deleted text.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See get_char_count().
|
|
|