Gtk.EntryBuffer.prototype.insert_text

function insert_text(position:Number, chars:String, n_chars:Number):Number {
    // Gjs wrapper for gtk_entry_buffer_insert_text()
}

Inserts n_chars characters of chars into the contents of the buffer, at position position.

If n_chars is negative, then characters from chars will be inserted until a null-terminator is found. If position or n_chars are out of bounds, or the maximum buffer text length is exceeded, then they are coerced to sane values.

Note that the position and length are in characters, not in bytes.

Since 2.18

position

the position at which to insert text.

chars

the text to insert into the buffer.

n_chars

the length of the text in characters, or -1

Returns

The number of characters actually inserted.