Gtk2HsContentsIndex
Graphics.UI.Gtk.Entry.Editable
Contents
Data types
Methods
Signals
Description
  • This is an interface for simple single-line text editing widgets. It is implemented by Entry and SpinButton.
  • TODO
  • Find out if "insert-text" signal is useful and how to bind it. It is tricky because it has an in-out parameter.
Synopsis
data Editable
class GObjectClass o => EditableClass o
castToEditable :: GObjectClass obj => obj -> Editable
editableSelectRegion :: EditableClass ed => ed -> Int -> Int -> IO ()
editableGetSelectionBounds :: EditableClass ed => ed -> IO (Int, Int)
editableInsertText :: EditableClass ed => ed -> String -> Int -> IO Int
editableDeleteText :: EditableClass ed => ed -> Int -> Int -> IO ()
editableGetChars :: EditableClass ed => ed -> Int -> Int -> IO String
editableCutClipboard :: EditableClass ed => ed -> IO ()
editableCopyClipboard :: EditableClass ed => ed -> IO ()
editablePasteClipboard :: EditableClass ed => ed -> IO ()
editableDeleteSelection :: EditableClass ed => ed -> IO ()
editableSetEditable :: EditableClass ed => ed -> Bool -> IO ()
editableGetEditable :: EditableClass ed => ed -> IO Bool
editableSetPosition :: EditableClass ed => ed -> Int -> IO ()
editableGetPosition :: EditableClass ed => ed -> IO Int
onEditableChanged :: EditableClass ec => ec -> IO () -> IO (ConnectId ec)
afterEditableChanged :: EditableClass ec => ec -> IO () -> IO (ConnectId ec)
onDeleteText :: EditableClass ec => ec -> (Int -> Int -> IO ()) -> IO (ConnectId ec)
afterDeleteText :: EditableClass ec => ec -> (Int -> Int -> IO ()) -> IO (ConnectId ec)
Data types
data Editable
Instances
EditableClass Editable
GObjectClass Editable
class GObjectClass o => EditableClass o
Instances
EditableClass Entry
EditableClass SpinButton
EditableClass Editable
castToEditable :: GObjectClass obj => obj -> Editable
Methods
editableSelectRegion :: EditableClass ed => ed -> Int -> Int -> IO ()

Select a span of text.

  • A negative end position will make the selection extend to the end of the buffer.
  • Calling this function with start=1 and end=4 it will mark "ask" in the string "Haskell". (FIXME: verify)
editableGetSelectionBounds :: EditableClass ed => ed -> IO (Int, Int)

Get the span of the current selection.

  • The returned tuple is not ordered. The second index represents the position of the cursor. The first index is the other end of the selection. If both numbers are equal there is in fact no selection.
editableInsertText :: EditableClass ed => ed -> String -> Int -> IO Int

Insert new text at the specified position.

  • If the position is invalid the text will be inserted at the end of the buffer. The returned value reflects the actual insertion point.
editableDeleteText :: EditableClass ed => ed -> Int -> Int -> IO ()

Delete a given range of text.

  • If the end position is invalid, it is set to the lenght of the buffer.
  • start is restricted to 0..end.
editableGetChars :: EditableClass ed => ed -> Int -> Int -> IO String

Retrieve a range of characters.

  • Set end to a negative value to reach the end of the buffer.
editableCutClipboard :: EditableClass ed => ed -> IO ()
Cut the selected characters to the Clipboard.
editableCopyClipboard :: EditableClass ed => ed -> IO ()
Copy the selected characters to the Clipboard.
editablePasteClipboard :: EditableClass ed => ed -> IO ()
Paste the selected characters to the Clipboard.
editableDeleteSelection :: EditableClass ed => ed -> IO ()
Delete the current selection.
editableSetEditable :: EditableClass ed => ed -> Bool -> IO ()

Make the widget insensitive.

  • Called with False will make the text uneditable.
editableGetEditable :: EditableClass ed => ed -> IO Bool
Retrieves whether the text is editable.
editableSetPosition :: EditableClass ed => ed -> Int -> IO ()
Set the cursor to a specific position.
editableGetPosition :: EditableClass ed => ed -> IO Int
Get the current cursor position.
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 :: EditableClass ec => ec -> (Int -> Int -> IO ()) -> IO (ConnectId ec)
Emitted when a piece of text is deleted from the Editable widget.
afterDeleteText :: EditableClass ec => ec -> (Int -> Int -> IO ()) -> IO (ConnectId ec)
Produced by Haddock version 0.6