Gtk-- Reference: Gtk::Editable

Class Index | Cross Index | Namespace Index

# Class Gtk::Editable

Base class for text-editing widgets.
Contained in: Gtk
Derived from: Gtk::Widget
Derived by: Gtk::Entry Gtk::Text

#include <gtk--/editable.h>

### public function member index:
`` | `Editable` | `()`;
``signal` `void`` | `activate` | `()`;
``emitable` `signal` `void`` | `changed` | `()`;
``void`` | `claim_selection` | `(`gboolean` `claim`, `guint32` `time`)`;
``emitable` `signal` `void`` | `copy_clipboard` | `()`;
``emitable` `signal` `void`` | `cut_clipboard` | `()`;
``void`` | `delete_selection` | `()`;
``emitable` `signal` `void`` | `delete_text` | `(`gint`, `gint`)`;
``string`` | `get_chars` | `(`int` `start_pos` = 0, `int` `end_pos` = - 1) `const``;
``gint`` | `get_position` | `() `const``;
``guint`` | `get_selection_end_pos` | `() `const``;
``guint`` | `get_selection_start_pos` | `() `const``;
``GtkEditable`*` | `gtkobj` | `()`;
``const` `GtkEditable`*` | `gtkobj` | `() `const``;
``bool`` | `has_selection` | `() `const``;
``emitable` `signal` `void`` | `insert_text` | `(`const` `gchar`*, `gint`, `gint`*)`;
``static` `bool`` | `isA` | `(`Object`* `object`)`;
``signal` `void`` | `kill_char` | `(`gint`)`;
``signal` `void`` | `kill_line` | `(`gint`)`;
``signal` `void`` | `kill_word` | `(`gint`)`;
``signal` `void`` | `move_cursor` | `(`gint`, `gint`)`;
``signal` `void`` | `move_page` | `(`gint`, `gint`)`;
``signal` `void`` | `move_to_column` | `(`gint`)`;
``signal` `void`` | `move_to_row` | `(`gint`)`;
``signal` `void`` | `move_word` | `(`gint`)`;
``emitable` `signal` `void`` | `paste_clipboard` | `()`;
``void`` | `select_region` | `(`gint` `start`, `gint` `end`)`;
``emitable` `signal` `void`` | `set_editable` | `(`gboolean`)`;
``virtual`` | `~Editable` | `()`;
### protected function member index:
``virtual` `void`` | `activate_impl` | `()`;
``virtual` `void`` | `changed_impl` | `()`;
``virtual` `void`` | `copy_clipboard_impl` | `()`;
``virtual` `void`` | `cut_clipboard_impl` | `()`;
``virtual` `void`` | `delete_text_impl` | `(`gint` `p0`, `gint` `p1`)`;
``virtual` `void`` | `insert_text_impl` | `(`const` `gchar`* `p0`, `gint` `p1`, `gint`* `p2`)`;
``virtual` `void`` | `kill_char_impl` | `(`gint` `p0`)`;
``virtual` `void`` | `kill_line_impl` | `(`gint` `p0`)`;
``virtual` `void`` | `kill_word_impl` | `(`gint` `p0`)`;
``virtual` `void`` | `move_cursor_impl` | `(`gint` `p0`, `gint` `p1`)`;
``virtual` `void`` | `move_page_impl` | `(`gint` `p0`, `gint` `p1`)`;
``virtual` `void`` | `move_to_column_impl` | `(`gint` `p0`)`;
``virtual` `void`` | `move_to_row_impl` | `(`gint` `p0`)`;
``virtual` `void`` | `move_word_impl` | `(`gint` `p0`)`;
``virtual` `void`` | `paste_clipboard_impl` | `()`;
``virtual` `void`` | `set_editable_impl` | `(`gboolean` `p0`)`;

## Description:

The `Gtk::Editable` class is a base class for widgets for editing text, such as `Gtk::Entry` and `Gtk::Text`. It cannot be instantiated by itself. The editable class 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.

## Function Member Descriptions:

Gtk::Editable::activate - Indicates that the user has activated the widget in some fashion.

``signal` `void`` `activate``()`;
``virtual` `void`` `activate_impl``()`;

> Generally, this will be done with a keystroke. (The default binding for this action is Return for `Gtk::Entry` and Control-Return for `Gtk::Text`.)

Gtk::Editable::changed - Indicates that the user has changed the contents of the widget.

``emitable` `signal` `void`` `changed``()`;
``virtual` `void`` `changed_impl``()`;
Gtk::Editable::claim_selection - Claim or disclaim ownership of the PRIMARY X selection.

``void`` `claim_selection``(`gboolean` `claim`, `guint32` `time`)`;

> claim: If TRUE, claim the selection, otherwise, disclaim it.

> time: The timestamp for claiming the selection.

Gtk::Editable::copy_clipboard - An action signal. Causes the characters in the current selection to be copied to the clipboard.

``emitable` `signal` `void`` `copy_clipboard``()`;
``virtual` `void`` `copy_clipboard_impl``()`;
Gtk::Editable::cut_clipboard - An action signal. Causes the characters in the current selection to be copied to the clipboard and then deleted from the widget.

``emitable` `signal` `void`` `cut_clipboard``()`;
``virtual` `void`` `cut_clipboard_impl``()`;
Gtk::Editable::delete_selection - Deletes the current contents of the widgets selection and disclaims the selection.

``void`` `delete_selection``()`;
Gtk::Editable::delete_text - This signal is emitted when text is deleted from the widget by the user.

``emitable` `signal` `void`` `delete_text``(`gint`, `gint`)`;
``virtual` `void`` `delete_text_impl``(`gint` `p0`, `gint` `p1`)`;

> 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, it is possible to modify the deleted text, or prevent it from being deleted entirely. The start_pos and end_pos parameters are interpreted as for `delete_text`.

Gtk::Editable::get_chars - Retrieves a sequence of characters.

``string`` `get_chars``(`int` `start_pos` = 0, `int` `end_pos` = - 1) `const``;

> The characters that are retrieved are those characters at positions from start_pos up to, but not including end_pos. If end_pos is negative, then the the characters retrieved will be those characters from start_pos to the end of the text.

> start_pos: The starting position.

> end_pos: The end position.

> Returns: The characters in the indicated region.

Gtk::Editable::get_position - Retrieves the current cursor position.

``gint`` `get_position``() `const``;

> Returns : the position of the cursor. The cursor is displayed before the character with the given (base 0) index in the widget. The value will be less than or equal to the number of characters in the widget. Note that this position is in characters, not in bytes.

Gtk::Editable::gtkobj - Returns the underlaying gtk+ object.

``GtkEditable`*` `gtkobj``()`;
Gtk::Editable::insert_text - This signal is emitted when text is inserted into the widget by the user.

``emitable` `signal` `void`` `insert_text``(`const` `gchar`*, `gint`, `gint`*)`;
``virtual` `void`` `insert_text_impl``(`const` `gchar`* `p0`, `gint` `p1`, `gint`* `p2`)`;

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

Gtk::Editable::isA - Returns true if object is this type.

``static` `bool`` `isA``(`Object`* `object`)`;
Gtk::Editable::kill_char - An action signal. Delete a single character.

``signal` `void`` `kill_char``(`gint`)`;
``virtual` `void`` `kill_char_impl``(`gint` `p0`)`;
Gtk::Editable::kill_line - An action signal. Delete a single line.

``signal` `void`` `kill_line``(`gint`)`;
``virtual` `void`` `kill_line_impl``(`gint` `p0`)`;
Gtk::Editable::kill_word - An action signal. Delete a single word.

``signal` `void`` `kill_word``(`gint`)`;
``virtual` `void`` `kill_word_impl``(`gint` `p0`)`;
Gtk::Editable::move_cursor - An action signal. Move the cursor position.

``signal` `void`` `move_cursor``(`gint`, `gint`)`;
``virtual` `void`` `move_cursor_impl``(`gint` `p0`, `gint` `p1`)`;
Gtk::Editable::move_page - An action signal. Move the cursor by pages.

``signal` `void`` `move_page``(`gint`, `gint`)`;
``virtual` `void`` `move_page_impl``(`gint` `p0`, `gint` `p1`)`;
Gtk::Editable::move_to_column - An action signal. Move the cursor to the given column.

``signal` `void`` `move_to_column``(`gint`)`;
``virtual` `void`` `move_to_column_impl``(`gint` `p0`)`;
Gtk::Editable::move_to_row - An action signal. Move the cursor to the given row.

``signal` `void`` `move_to_row``(`gint`)`;
``virtual` `void`` `move_to_row_impl``(`gint` `p0`)`;
Gtk::Editable::move_word - An action signal. Move the cursor by words.

``signal` `void`` `move_word``(`gint`)`;
``virtual` `void`` `move_word_impl``(`gint` `p0`)`;
Gtk::Editable::paste_clipboard - An action signal. Causes the contents of the clipboard to be pasted into the editable widget at the current cursor position.

``emitable` `signal` `void`` `paste_clipboard``()`;
``virtual` `void`` `paste_clipboard_impl``()`;
Gtk::Editable::select_region - Selects a region of text.

``void`` `select_region``(`gint` `start`, `gint` `end`)`;

> The characters that are selected are those characters at positions from start_pos up to, but not including end_pos. If end_pos is negative, then the the characters selected will be those characters from start_pos to the end of the text.

> start: The starting position.

> end: The end position.

Gtk::Editable::set_editable - Determines if the user can edit the text in the editable widget or not.

``emitable` `signal` `void`` `set_editable``(`gboolean`)`;
``virtual` `void`` `set_editable_impl``(`gboolean` `p0`)`;

> This is meant to be overriden by child classes and should not generally useful to applications.