Gtk.Editable
const Gtk = imports.gi.Gtk; let editable = new Gtk.Editable();
The Gtk.Editable interface is an interface which should be implemented by text editing widgets, such as Gtk.Entry and Gtk.SpinButton. 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 Gtk.insert-text, an application can convert all entry into a widget into uppercase.
<example> <title>Forcing entry to uppercase.</title> <programlisting> #include <ctype.h>
void insert_text_handler (GtkEditable *editable, const gchar *text, gint length, gint *position, gpointer data) { gchar *result = g_utf8_strup (text, length);
g_signal_handlers_block_by_func (editable, (gpointer) insert_text_handler, data); gtk_editable_insert_text (editable, result, length, position); g_signal_handlers_unblock_by_func (editable, (gpointer) insert_text_handler, data);
g_signal_stop_emission_by_name (editable, "insert_text");
g_free (result); } </programlisting> </example>
Hierarchy
- Gtk.Editable
Methods
- Gtk.Editable.prototype.copy_clipboard
- Gtk.Editable.prototype.cut_clipboard
- Gtk.Editable.prototype.delete_selection
- Gtk.Editable.prototype.delete_text
- Gtk.Editable.prototype.get_chars
- Gtk.Editable.prototype.get_editable
- Gtk.Editable.prototype.get_position
- Gtk.Editable.prototype.get_selection_bounds
- Gtk.Editable.prototype.insert_text
- Gtk.Editable.prototype.paste_clipboard
- Gtk.Editable.prototype.select_region
- Gtk.Editable.prototype.set_editable
- Gtk.Editable.prototype.set_position