|
Graphics.UI.Gtk.Entry.Editable | Portability | portable (depends on GHC) | Stability | provisional | Maintainer | gtk2hs-users@lists.sourceforge.net |
|
|
|
|
|
Description |
Interface for text-editing widgets
|
|
Synopsis |
|
|
|
|
Detail
|
|
The Editable interface is an interface which should be implemented by
text editing widgets, such as Entry.
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.
|
|
Class Hierarchy
|
|
| GInterface
| +----Editable
|
|
Types
|
|
data Editable |
Instances | |
|
|
class GObjectClass o => EditableClass o |
| Instances | |
|
|
castToEditable :: GObjectClass obj => obj -> Editable |
|
toEditable :: EditableClass o => o -> Editable |
|
Methods
|
|
editableSelectRegion |
:: EditableClass self | | => self | | -> Int | start - the starting position.
| -> Int | end - the end position.
| -> IO () | | Selects a region of text. The characters that are selected are those
characters at positions from startPos up to, but not including endPos.
If endPos is negative, then the the characters selected will be those
characters from startPos to the end of the text.
Calling this function with start=1 and end=4 it will mark "ask" in
the string "Haskell". (FIXME: verify)
|
|
|
editableGetSelectionBounds |
:: EditableClass self | | => self | | -> IO (Int, Int) | (start, end) - the starting and end positions. This
pair is not ordered. The end index represents the
position of the cursor. The start index is the other end
of the selection. If both numbers are equal there is in
fact no selection.
| Gets the current selection bounds, if there is a selection.
|
|
|
editableInsertText |
:: EditableClass self | | => self | | -> String | newText - the text to insert.
| -> Int | position - the position at which to insert the text.
| -> IO Int | returns the position after the newly inserted text.
| Inserts text at a given position.
|
|
|
editableDeleteText |
:: EditableClass self | | => self | | -> Int | startPos - the starting position.
| -> Int | endPos - the end position.
| -> IO () | | Deletes a sequence of characters. The characters that are deleted are
those characters at positions from startPos up to, but not including
endPos. If endPos is negative, then the the characters deleted will be
those characters from startPos to the end of the text.
|
|
|
editableGetChars |
:: EditableClass self | | => self | | -> Int | startPos - the starting position.
| -> Int | endPos - the end position.
| -> IO String | returns the characters in the indicated region.
| Retrieves a sequence of characters. The characters that are retrieved are
those characters at positions from startPos up to, but not including
endPos. If endPos is negative, then the the characters retrieved will be
those characters from startPos to the end of the text.
|
|
|
editableCutClipboard :: EditableClass self => self -> IO () |
Causes the characters in the current selection to be copied to the
clipboard and then deleted from the widget.
|
|
editableCopyClipboard :: EditableClass self => self -> IO () |
Causes the characters in the current selection to be copied to the
clipboard.
|
|
editablePasteClipboard :: EditableClass self => self -> IO () |
Causes the contents of the clipboard to be pasted into the given widget
at the current cursor position.
|
|
editableDeleteSelection :: EditableClass self => self -> IO () |
Deletes the current contents of the widgets selection and disclaims the
selection.
|
|
editableSetEditable |
:: EditableClass self | | => self | | -> Bool | isEditable - True if the user is allowed to edit the text
in the widget.
| -> IO () | | Determines if the user can edit the text in the editable widget or not.
|
|
|
editableGetEditable :: EditableClass self => self -> IO Bool |
Retrieves whether the text is editable. See editableSetEditable.
|
|
editableSetPosition |
:: EditableClass self | | => self | | -> Int | position - the position of the cursor. The cursor is
displayed before the character with the given (base 0) index in
the widget. The value must be less than or equal to the number of
characters in the widget. A value of -1 indicates that the
position should be set after the last character in the entry.
| -> IO () | | Sets the cursor position.
|
|
|
editableGetPosition |
:: EditableClass self | | => self | | -> IO Int | 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.
| Retrieves the current cursor position.
|
|
|
Attributes
|
|
editablePosition :: EditableClass self => Attr self Int |
'position' property. See editableGetPosition and
editableSetPosition
|
|
editableEditable :: EditableClass self => Attr self Bool |
'editable' property. See editableGetEditable and
editableSetEditable
|
|
Signals
|
|
onEditableChanged :: EditableClass ec => ec -> IO () -> IO (ConnectId ec) |
Emitted when the settings of the Editable widget changes.
|
|
afterEditableChanged :: EditableClass ec => ec -> IO () -> IO (ConnectId ec) |
|
onDeleteText |
|
|
afterDeleteText |
|
|
Produced by Haddock version 0.7 |