Interface

Gtk-4.0GtkEditableSignalSignatures

interface SignalSignatures {
    changed: () => void;
    "delete-text": (start_pos: number, end_pos: number) => void;
    "input-intercepted": () => void;
    "insert-text": (text: string, length: number, position: number) => void;
}

Hierarchy (View Summary)

Index
changed: () => void

Emitted at the end of a single user-visible operation on the contents.

E.g., 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).

"delete-text": (start_pos: number, end_pos: number) => void

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 g_signal_stop_emission(), it is possible to modify the range of deleted text, or prevent it from being deleted entirely.

The start_pos and end_pos parameters are interpreted as for Gtk.Editable.delete_text.

"input-intercepted": () => void

Emitted whenever keyboard input has been handled through the input interceptor widget set through Gtk.Editable.set_input_interceptor

A typical reaction to this event would be to show and focus editable, so that input is handled directly. In that case keyboard input will no longer be handled through the input interceptor and this signal will stop being emitted.

4.24

"insert-text": (text: string, length: number, position: number) => void

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 g_signal_stop_emission(), it is possible to modify the inserted text, or prevent it from being inserted entirely.