Package: gtk

Function gtk-text-buffer-insert

Lambda List

gtk-text-buffer-insert (buffer text &key position interactive editable)

Syntax

(gtk-text-buffer-insert buffer text) => t
(gtk-text-buffer-insert buffer text :position position) => t
(gtk-text-buffer-insert buffer text :interactive t) => t
(gtk-text-buffer-insert buffer text :interactive t :editable nil) => t

Arguments

buffer -- a gtk-text-buffer object
text -- a string with the text in UTF-8 format
position -- a gtk-text-iter iterator or the default value :cursor
interactive -- a boolean whether the deletion is caused by user interaction, the default value is false
editable -- a boolean whether buffer is editable by default, the default value is true

Return Value

A boolean whether the text was actually inserted.

Details

Inserts text in the text buffer.

If the position keyword argument has the :cursor value, the default, inserts the text using the current cursor position as the insertion point.

If the interactive keyword argument is true, the insertion will not occur if the iterator is at a non-editable location in the text buffer. Usually you want to prevent insertions at ineditable locations if the insertion results from a user action (is interactive).

The editable keyword argument indicates the editability of text that does not have a tag affecting editability applied to it. Typically the result of the gtk-text-view-editable function is appropriate here.

Emits the "insert-text" signal. Insertion actually occurs in the default handler for the signal. The iterator is invalidated when insertion occurs, because the text buffer contents change, but the default signal handler revalidates it to point to the end of the inserted text.

Note

The gtk-text-buffer-insert function combines the gtk_text_buffer_insert(), gtk_text_buffer_insert_at_cursor(), gtk_text_buffer_insert_interactive(), and gtk_text_buffer_insert_interactive_at_cursor() functions into one function using the position, interactive, and editable keyword arguments. The corresponding Lisp functions except for gtk-text-buffer-insert are not exported in the Lisp implementation.
 

See also

2021-11-16