GtkEditable {RGtk2}R Documentation

GtkEditable

Description

Interface for text-editing widgets

Methods and Functions

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)

Hierarchy

  GInterface
   +----GtkEditable

Implementations

GtkEditable is implemented by GtkEntry, GtkText, GtkOldEditable and GtkSpinButton.

Detailed Description

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.

insert_text_handler <- function(editable, text, length, position, id)
{
  result <- toupper(text)
  gSignalHandlerBlock(editable, id)
  editable$insertText(result, length, position)
  gSignalHandlerUnblock(editable, id)
}

Structures

GtkEditable
The GtkEditable structure contains the following fields. (These fields should be considered read-only. They should never be set by an application.)

numeric selection_start; the starting position of the selected characters in the widget.
numeric selection_end; the end position of the selected characters in the widget.
numeric editable; a flag indicating whether or not the widget is editable by the user.

Signals

The (editable, user.data)
Indicates that the user has changed the contents of the widget.

editable
[GtkEditable] the object which received the signal.
user.data
[R object] user data set when the signal handler was connected.

The (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 inserting the text, so by connecting to this signal and then stopping the signal with gtkSignalEmitStop(), it is possible to modify the inserted text, or prevent it from being inserted entirely. The start.pos and end.pos parameters are interpreted as for gtkEditableDeleteText

editable
[GtkEditable] the object which received the signal.
start.pos
[integer] the starting position.
end.pos
[integer] the end position.
user.data
[R object] user data set when the signal handler was connected.

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

editable
[GtkEditable] the object which received the signal.
new.text
[character] the new text to insert.
new.text.length
[integer] the length of the new text, in bytes, or -1 if new_text is nul-terminated
position
[integer] the 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.data
[R object] user data set when the signal handler was connected.

Author(s)

Derived by RGtkGen from GTK+ documentation

References

http://developer.gnome.org/doc/API/2.0/gtk/GtkEditable.html


[Package RGtk2 version 2.12.5-3 Index]