Editable
Object Hierarchy:
Gtk.Editable
Gtk.Editable
Gtk.Editable
GLib.Object
GLib.Object
GLib.Object->Gtk.Editable
Description:
[
CCode ( type_cname =
"GtkEditableInterface" , type_id =
"gtk_editable_get_type ()" ) ]
public interface Editable :
Object
The Editable interface is an interface which should be implemented by text editing widgets, such as
Entry and 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
insert_text , an application can convert all entry into a widget into uppercase.
Forcing entry to uppercase.
#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); }
All known implementing classes:
Content:
Methods:
public void copy_clipboard ()
Copies the contents of the currently selected content in the editable and
puts it on the clipboard.
public void cut_clipboard ()
Removes the contents of the currently selected content in the editable and
puts it on the clipboard.
public void delete_selection ()
Deletes the currently selected text of the editable.
public virtual void do_delete_text (int start_pos, int end_pos)
Deletes a sequence of characters.
public virtual void do_insert_text (string new_text, int new_text_length, ref int position)
Inserts new_text_length
bytes of new_text
into the
contents of the widget, at position position
.
public abstract string get_chars (int start_pos = 0 , int end_pos = -1 )
Retrieves a sequence of characters.
public bool get_editable ()
Retrieves whether this is editable.
public abstract int get_position ()
Retrieves the current position of the cursor relative to the start of the
content of the editable.
public abstract bool get_selection_bounds (out int start_pos, out int end_pos)
Retrieves the selection bound of the editable.
public void paste_clipboard ()
Pastes the content of the clipboard to the current position of the cursor in
the editable.
public abstract void select_region (int start_pos, int end_pos)
Selects a region of text.
public void set_editable (bool is_editable)
Determines if the user can edit the text in the editable widget or not.
public abstract void set_position (int position)
Sets the cursor position in the editable to the given value.
Signals:
public virtual signal void changed ()
The changed signal is emitted at the end of a
single user-visible operation on the contents of the Editable .
public virtual signal void delete_text (int start_pos, int end_pos)
This signal is emitted when text is deleted from the widget by the user.
public virtual signal void insert_text (string new_text, int new_text_length, ref int position)
This signal is emitted when text is inserted into the widget by the user.
Inherited Members:
All known members inherited from class GLib.Object