6.25 GtkTextBufferCommitNotify

Callback: GtkTextBufferCommitNotify

A procedure given for it is called as (procedure buffer flags position length).

A notification callback used by text-buffer:add-commit-notify.

You may not modify the <GtkTextBuffer> from a GtkTextBufferCommitNotify callback and that is enforced by the <GtkTextBuffer> API.

GtkTextBufferCommitNotify may be used to be notified about changes to the underlying buffer right before-or-after the changes are committed to the underlying B-Tree. This is useful if you want to observe changes to the buffer without other signal handlers potentially modifying state on the way to the default signal handler.

When flags is before-insert, position is set to the offset in characters from the start of the buffer where the insertion will occur. length is set to the number of characters to be inserted. You may not yet retrieve the text until it has been inserted. You may access the text from after-insert using text-buffer:get-slice.

When flags is after-insert, position is set to offset in characters where the insertion occurred and length is set to the number of characters inserted.

When flags is before-delete, position is set to offset in characters where the deletion will occur and length is set to the number of characters that will be removed. You may still retrieve the text from this handler using position and length.

When flags is after-delete, length is set to zero to denote that the delete-range has already been committed to the underlying B-Tree. You may no longer retrieve the text that has been deleted from the <GtkTextBuffer>.

buffer

Passed: a <GtkTextBuffer>.

the text buffer being notified

flags

Passed: a <GtkTextBufferNotifyFlags>.

the type of commit notification

position

Passed: an unsigned 32-bit integer.

the position of the text operation

length

Passed: an unsigned 32-bit integer.

the length of the text operation in characters

user-data

Not passed: it is the user data that guile-gi supplied.

user data passed to the callback