Description Methods and Functions Hierarchy Implementations Detailed Description Structures Signals Author(s) References
Interface for text-editing widgets
gtkEditableSelectRegion(object, start, end)
gtkEditableGetSelectionBounds(object)
gtkEditableInsertText(object, new.text, position = 0)
gtkEditableDeleteText(object, start.pos, end.pos)
gtkEditableGetChars(object, start.pos, end.pos)
gtkEditableCutClipboard(object)
gtkEditableCopyClipboard(object)
gtkEditablePasteClipboard(object)
gtkEditableDeleteSelection(object)
gtkEditableSetPosition(object, position)
gtkEditableGetPosition(object)
gtkEditableSetEditable(object, is.editable)
gtkEditableGetEditable(object)
1 2 | GInterface
+----GtkEditable
|
GtkEditable is implemented by
GtkEntry, GtkOldEditable, GtkSpinButton and GtkText.
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.
Forcing entry to uppercase.
1 2 3 4 5 6 7 | insert_text_handler <- function(editable, text, length, position, id)
{
result <- toupper(text)
gSignalHandlerBlock(editable, id)
editable$insertText(result, length, position)
gSignalHandlerUnblock(editable, id)
}
|
GtkEditableThe GtkEditable structure is an opaque structure whose members
cannot be directly accessed.
changed(editable, user.data)The ::changed signal is emitted at the end of a single
user-visible operation on the contents of the GtkEditable.
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).
editablethe object which received the signal
user.datauser data set when the signal handler was connected.
delete-text(editable, start.pos, end.pos, user.data)This signal is 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 gSignalStopEmission, 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
gtkEditableDeleteText.
editablethe object which received the signal
start.posthe starting position
end.posthe end position
user.datauser data set when the signal handler was connected.
insert-text(editable, new.text, new.text.length, position, user.data)This signal is 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 gSignalStopEmission, it
is possible to modify the inserted text, or prevent
it from being inserted entirely.
editablethe object which received the signal
new.textthe new text to insert
new.text.lengththe length of the new text, in bytes, or -1 if new_text is nul-terminated
positionthe position, in characters, at which to insert the new text. this is an in-out parameter. After the signal emission is finished, it should point after the newly inserted text.
user.datauser data set when the signal handler was connected.
Derived by RGtkGen from GTK+ documentation
https://developer.gnome.org/gtk2/stable/GtkEditable.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.