interface is an interface which should be implemented by text editing widgets, such as the
widget.
It contains functions for generically manipulating an editable widget, a large
number of action signals used for key bindings, and several signals that an
application can connect to to modify the behavior of a widget.
As an example of the latter usage, by connecting the following handler to the
signal, an application can convert all
entry into a widget into uppercase.
The "changed" signal
lambda (editable) :run-last
The signal is emitted at the end of a single user visible operation on the contents of the
gtk:editable widget. For example, a paste
operation that replaces the contents of the selection will cause only one
signal emission, even though it is implemented by first deleting the
selection, then inserting the new content, and may cause multiple
"notify::text" signals to be emitted.
The "delete-text" signal
lambda (editable start end) :run-last
- editable
- The gtk:editable widget that received the signal.
- start
- The integer for the start position.
- end
- The integer for the end position.
The signal is emitted when text is deleted from the widget by the user.
The default handler for this signal will normally be responsible for
deleting the text, so by connecting to this signal and then stopping the signal with the
g:signal-stop-emission function, it is possible to
modify the range of deleted text, or prevent it from being deleted entirely. The
start and
end parameters are interpreted as for the
gtk:editable-delete-text function.
The "insert-text" signal
lambda (editable text length pos) :run-last
- editable
- The gtk:editable widget that received the signal.
- text
- The string for the new text to insert.
- length
- The integer for the length of the new text, in bytes, or -1 if text is nul-terminated.
- pos
- The pointer to an integer with the position, in characters,
at which to insert the new text. This is an in-out parameter. After
the signal emission is finished, it should point after the newly inserted text. The Lisp value of pos is returned by the (cffi:mem-ref pos :intptr) call.
The signal is emitted when text is inserted into the widget by the user.
The default handler for this signal will normally be responsible for
inserting the text, so by connecting to this signal and then stopping the signal with the
g:signal-stop-emission function, it is possible to
modify the inserted text, or prevent it from being inserted entirely.