Forum und email

GtkEditable

Interface for text-editing widgets.

对象层次

GInterface
`-- GtkEditable

执行

描述

这是接口,不可以直接访问。

The GtkEditable interface is an interface which should be implemented by text editing widgets, such as GtkEntry and GtkText. 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.

方法

copy_clipboard()
  Copy the current selection into clipboard.
cut_clipboard()
  Copy the current selection into clipboard & delete.
delete_selection()
  Deletes the current contents of the selection.
delete_text()
  Deletes a sequence of characters.
get_chars()
  Retrieves a sequence of characters.
get_editable()
  If the text can be changed.
get_position()
  Retrieves the current cursor position.
get_selection_bounds()
  Gets the current selection bounds.
insert_text()
  Inserts text at a given position.
paste_clipboard()
  Paste the clipboard contents at the current cursor position.
select_region()
  Selects a part of the text.
set_editable()
  If the user can edit the text in the editable widget.
set_position()
  Sets the cursor position.

属性

使用 get_property 和 set_property 方法访问这些。

editable:
  Whether or not the widget is editable by the user.
selection_start:
  The starting position of the selected characters in the widget.
selection_end:
  The end position of the selected characters in the widget.

信号

"changed"
  Indicates that the user has changed the contents of the widget.
"delete-text"
  Emitted when text is deleted from the widget by the user.
"insert-text"
  Emitted when text is inserted into the widget by the user.