Name

Entry —

This widget lets the user enter a single line of text.

Synopsis

newtype
        Editable
entryNew:: IO Entry
entryAppendText:: EntryClass ec => ec -> String -> IO ()
entryCopyClipboard:: EntryClass ed => ed -> IO ()
entryCutClipboard:: EntryClass ed => ed -> IO ()
entryDeleteSelection:: EntryClass ed => ed -> IO ()
entryDeleteText:: EntryClass ed => ed -> Int -> Int -> IO ()
entryGetActivatesDefault:: EntryClass ec => ec -> IO Bool
entryGetChars:: EntryClass ed => ed -> Int -> Int -> IO String
entryGetHasFrame:: EntryClass ec => ec -> IO Bool
entryGetPosition:: EntryClass ed => ed -> IO Int
entryGetSelectionBounds:: EntryClass ed => ed -> IO (Int,Int)
entryGetText:: EntryClass ec => ec -> IO String
entryGetWidthChars:: EntryClass ec => ec -> IO Int
entryInsertText:: EntryClass ed => ed -> String -> Int -> IO Int
entryPasteClipboard:: EntryClass ed => ed -> IO ()
entryPrependText:: EntryClass ec => ec -> String -> IO ()
entrySelectRegion:: EntryClass ed => ed -> Int -> Int -> IO ()
entrySetActivatesDefault:: EntryClass ec => ec -> Bool -> IO ()
entrySetEditable:: EntryClass ed => ed -> Bool -> IO ()
entrySetHasFrame:: EntryClass ec => ec -> Bool -> IO ()
entrySetInvisibleChar:: EntryClass ec => ec -> Char -> IO ()
entrySetMaxLength:: EntryClass ec => ec -> Int -> IO ()
entrySetPosition:: EntryClass ed => ed -> Int -> IO ()
entrySetText:: EntryClass ec => ec -> String -> IO ()
entrySetVisibility:: EntryClass ec => ec -> Bool -> IO ()
entrySetWidthChars:: EntryClass ec => ec -> Int -> IO ()
onCopyClipboard:: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
onCutClipboard:: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
onDeleteText:: EntryClass ec => ec -> (Int -> Int -> IO ()) -> IO (ConnectId ec)
onEntryActivate:: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
onEntryChanged:: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
onInsertAtCursor:: EntryClass ec => ec -> (String -> IO ()) -> IO (ConnectId ec)
onPasteClipboard:: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
onToggleOverwrite:: EntryClass ec => ec -> IO () -> IO (ConnectId ec)

Todo

A couple of signals are not bound because I could not figure out what they mean. Some of them do not seem to be emitted at all.

Datatypes

newtype Editable

newtype Editable =Editable (ForeignPtr (Editable))

Constructors

entryNew

Create a new Entry widget.

entryNew

Methods

entryAppendText

Append to the text of the Entry widget.

entryAppendText:: ec:: String:: IO ()
ecstr

entryCopyClipboard

Copy the selected characters to the Clipboard.

entryCopyClipboard:: ed:: IO ()

entryCutClipboard

Cut the selected characters to the Clipboard.

entryCutClipboard:: ed:: IO ()

entryDeleteSelection

Delete the current selection.

entryDeleteSelection:: ed:: IO ()

entryDeleteText

Delete a given range of text.

entryDeleteText:: ed:: Int:: Int:: IO ()
edstartend

If the end position is invalid, it is set to the lenght of the buffer.

start is restricted to 0.. end.

entryGetActivatesDefault

Query whether pressing return will activate the default widget.

entryGetActivatesDefault:: ec:: IO Bool
ec

entryGetChars

Retrieve a range of characters.

entryGetChars:: ed:: Int:: Int:: IO String
edstartend

Set end to a negative value to reach the end of the buffer.

entryGetHasFrame

Query if the text Entry is displayed with a frame around it.

entryGetHasFrame:: ec:: IO Bool
ec

entryGetPosition

Get the current cursor position.

entryGetPosition:: ed:: IO Int
ed

entryGetSelectionBounds

Get the span of the current selection.

entryGetSelectionBounds:: ed:: IO (Int,Int)
ed

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.

entryGetText

Get the text of the Entry widget.

entryGetText:: ec:: IO String
ec

entryGetWidthChars

Retrieve the number of characters the widget should ask for.

entryGetWidthChars:: ec:: IO Int
ec

entryInsertText

Insert new text at the specified position.

entryInsertText:: ed:: String:: Int:: IO Int
edstrpos

If the position is invalid the text will be inserted at the end of the buffer. The returned value reflects the actual insertion point.

entryPasteClipboard

Paste the selected characters to the Clipboard.

entryPasteClipboard:: ed:: IO ()

entryPrependText

Prepend the text of the Entry widget.

entryPrependText:: ec:: String:: IO ()
ecstr

entrySelectRegion

Select a span of text.

entrySelectRegion:: ed:: Int:: Int:: IO ()
edstartend

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)

entrySetActivatesDefault

Specify if pressing return will activate the default widget.

entrySetActivatesDefault:: ec:: Bool:: IO ()
ecsetting

This setting is useful in Dialog boxes where enter should press the default button.

entrySetEditable

Make an Entry insensitive.

entrySetEditable:: ed:: Bool:: IO ()
edisEditable

Called with False will make the text uneditable.

entrySetHasFrame

Specifies whehter the Entry should be in an etched-in frame.

entrySetHasFrame:: ec:: Bool:: IO ()
ecsetting

entrySetInvisibleChar

Set the replacement character for invisible text.

entrySetInvisibleChar:: ec:: Char:: IO ()
ecch

entrySetMaxLength

Sets a maximum length the text may grow to.

entrySetMaxLength:: ec:: Int:: IO ()
ecmax

A negative number resets the restriction.

entrySetPosition

Set the cursor to a specific position.

entrySetPosition:: ed:: Int:: IO ()
edpos

entrySetText

Set the text of the Entry widget.

entrySetText:: ec:: String:: IO ()
ecstr

entrySetVisibility

Set whether to use password mode (display stars instead of the text).

entrySetVisibility:: ec:: Bool:: IO ()
ecvisible

The replacement character can be changed with entrySetInvisibleChar.

entrySetWidthChars

Specifies how large the Entry should be in characters.

entrySetWidthChars:: ec:: Int:: IO ()
ecsetting

This setting is only considered when the widget formulates its size request. Make sure that it is not mapped (shown) before you change this value.

Signals

onCopyClipboard

Emitted when the current selection has been copied to the clipboard.

onCopyClipboard:: ec:: IO ():: IO (ConnectId ec)

onCutClipboard

Emitted when the current selection has been cut to the clipboard.

onCutClipboard:: ec:: IO ():: IO (ConnectId ec)

onDeleteText

Emitted when a piece of text is deleted from the Entry.

onDeleteText:: ec:: (Int -> Int -> IO ()):: IO (ConnectId ec)

onEntryActivate

Emitted when the user presses return within the Entry field.

onEntryActivate:: ec:: IO ():: IO (ConnectId ec)

onEntryChanged

Emitted when the settings of the Entry widget changes.

onEntryChanged:: ec:: IO ():: IO (ConnectId ec)

onInsertAtCursor

Emitted when a piece of text is inserted at the cursor position.

onInsertAtCursor:: ec:: (String -> IO ()):: IO (ConnectId ec)

onPasteClipboard

Emitted when the current selection has been pasted from the clipboard.

onPasteClipboard:: ec:: IO ():: IO (ConnectId ec)

onToggleOverwrite

Emitted when the user changes from overwriting to inserting.

onToggleOverwrite:: ec:: IO ():: IO (ConnectId ec)