Package: gtk

Function gtk:text-buffer-insert

Lambda List

gtk:text-buffer-insert (buffer pos text &key interactive editable)

Syntax

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

Arguments

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

Return Value

True if the text was actually inserted.

Details

Inserts text in the text buffer. If the pos argument has the :cursor value, 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.

Notes

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 interactive, and editable keyword arguments. The corresponding Lisp functions except for the gtk:text-buffer-insert function are not exported in the Lisp implementation.
 

See also

2024-7-3