| gtk-0.11.2: Binding to the Gtk+ graphical user interface library. | Contents | Index
Graphics.UI.Gtk.Entry.Entry |
Portability | portable (depends on GHC)
Stability | provisional
Maintainer | gtk2hs-users@lists.sourceforge.net
Contents
Detail Class Hierarchy Types Constructors Methods Attributes Signals
Description
A single line text entry field
Synopsis
data Entry
class WidgetClass o => EntryClass o
castToEntry :: GObjectClass obj => obj -> Entry
gTypeEntry :: GType
toEntry :: EntryClass o => o -> Entry
entryNew :: IO Entry
entrySetText :: EntryClass self => self -> String -> IO ()
entryGetText :: EntryClass self => self -> IO String
entryAppendText :: EntryClass self => self -> String -> IO ()
entryPrependText :: EntryClass self => self -> String -> IO ()
entrySetVisibility :: EntryClass self => self -> Bool -> IO ()
entryGetVisibility :: EntryClass self => self -> IO Bool
entrySetInvisibleChar :: EntryClass self => self -> Char -> IO ()
entryGetInvisibleChar :: EntryClass self => self -> IO Char
entrySetMaxLength :: EntryClass self => self -> Int -> IO ()
entryGetMaxLength :: EntryClass self => self -> IO Int
entryGetActivatesDefault :: EntryClass self => self -> IO Bool
entrySetActivatesDefault :: EntryClass self => self -> Bool -> IO ()
entryGetHasFrame :: EntryClass self => self -> IO Bool
entrySetHasFrame :: EntryClass self => self -> Bool -> IO ()
entryGetWidthChars :: EntryClass self => self -> IO Int
entrySetWidthChars :: EntryClass self => self -> Int -> IO ()
entrySetAlignment :: EntryClass self => self -> Float -> IO ()
entryGetAlignment :: EntryClass self => self -> IO Float
entrySetCompletion :: EntryClass self => self -> EntryCompletion -> IO ()
entryGetCompletion :: EntryClass self => self -> IO EntryCompletion
entryCursorPosition :: EntryClass self => ReadAttr self Int
entrySelectionBound :: EntryClass self => ReadAttr self Int
entryEditable :: EntryClass self => Attr self Bool
entryMaxLength :: EntryClass self => Attr self Int
entryVisibility :: EntryClass self => Attr self Bool
entryHasFrame :: EntryClass self => Attr self Bool
entryInvisibleChar :: EntryClass self => Attr self Char
entryActivatesDefault :: EntryClass self => Attr self Bool
entryWidthChars :: EntryClass self => Attr self Int
entryScrollOffset :: EntryClass self => ReadAttr self Int
entryText :: EntryClass self => Attr self String
entryXalign :: EntryClass self => Attr self Float
entryAlignment :: EntryClass self => Attr self Float
entryCompletion :: EntryClass self => Attr self EntryCompletion
onEntryActivate :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
afterEntryActivate :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
onCopyClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
afterCopyClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
onCutClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
afterCutClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
onPasteClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
afterPasteClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
onToggleOverwrite :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
afterToggleOverwrite :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
Detail
The `Entry` widget is a single line text entry widget. A fairly large set of key bindings are supported by default. If the entered text is longer than the allocation of the widget, the widget will scroll so that the cursor position is visible.
Class Hierarchy
     | GObject
     | +----Object
     | +----Widget
     | +----Entry
     | +----SpinButton
Types
data Entry
Instances
Eq Entry |
Ord Entry |
GObjectClass Entry |
EditableClass Entry |
EntryClass Entry |
WidgetClass Entry |
ObjectClass Entry |
class WidgetClass o => EntryClass o
Instances
EntryClass SpinButton |
EntryClass Entry |
castToEntry :: GObjectClass obj => obj -> Entry
gTypeEntry :: GType
toEntry :: EntryClass o => o -> Entry
Constructors
entryNew :: IO Entry
Creates a new `Entry` widget.
Methods
entrySetText :: EntryClass self => self -> String -> IO ()
Sets the text in the widget to the given value, replacing the current contents.
entryGetText :: EntryClass self => self -> IO String
Retrieves the contents of the entry widget. See also Graphics.UI.Gtk.Display.Entry.Editable.editableGetChars.
entryAppendText :: EntryClass self => self -> String -> IO ()
Appends the given text to the contents of the widget. Warning: this function is deprecated and should not be used in newly-written code.
entryPrependText :: EntryClass self => self -> String -> IO ()
Prepends the given text to the contents of the widget. Warning: this function is deprecated and should not be used in newly-written code.
entrySetVisibility
:: EntryClass self |
=> self |
-> Bool | `visible` - `True` if the contents of the entry are displayed as plaintext.
-> IO () |
Sets whether the contents of the entry are visible or not. When visibility is set to `False`, characters are displayed as the invisible char, and will also appear that way when the text in the entry widget is copied elsewhere. The default invisible char is the asterisk '*', but it can be changed with `entrySetInvisibleChar`.
entryGetVisibility
:: EntryClass self |
=> self |
-> IO Bool | returns `True` if the text is currently visible
Retrieves whether the text in `entry` is visible. See `entrySetVisibility`.
entrySetInvisibleChar :: EntryClass self => self -> Char -> IO ()
Sets the character to use in place of the actual text when `entrySetVisibility` has been called to set text visibility to `False`. i.e. this is the character used in "password mode" to show the user how many characters have been typed. The default invisible char is an asterisk ('*'). If you set the invisible char to `'\0'`, then the user will get no feedback at all; there will be no text on the screen as they type.
entryGetInvisibleChar
:: EntryClass self |
=> self |
-> IO Char | returns the current invisible char, or `'\0'`, if the entry does not show invisible text at all.
Retrieves the character displayed in place of the real characters for entries with visisbility set to false. See `entrySetInvisibleChar`.
entrySetMaxLength
:: EntryClass self |
=> self |
-> Int | `max` - the maximum length of the entry, or 0 for no maximum. (other than the maximum length of entries.) The value passed in will be clamped to the range 0-65536.
-> IO () |
Sets the maximum allowed length of the contents of the widget. If the current contents are longer than the given length, then they will be truncated to fit.
entryGetMaxLength
:: EntryClass self |
=> self |
-> IO Int | returns the maximum allowed number of characters in `Entry`, or 0 if there is no maximum.
Retrieves the maximum allowed length of the text in `entry`. See `entrySetMaxLength`.
entryGetActivatesDefault
:: EntryClass self |
=> self |
-> IO Bool | returns `True` if the entry will activate the default widget
Query whether pressing return will activate the default widget.
entrySetActivatesDefault
:: EntryClass self |
=> self |
-> Bool | `setting` - `True` to activate window's default widget on Enter keypress
-> IO () |
If `setting` is `True`, pressing Enter in the `entry` will activate the default widget for the window containing the entry. This usually means that the dialog box containing the entry will be closed, since the default widget is usually one of the dialog buttons. (For experts: if `setting` is `True`, the entry calls Graphics.UI.Gtk.Windows.Window.windowActivateDefault on the window containing the entry, in the default handler for the "activate" signal.) This setting is useful in `Dialog` boxes where enter should press the default button.
entryGetHasFrame
:: EntryClass self |
=> self |
-> IO Bool | returns whether the entry has a beveled frame
Query if the text `Entry` is displayed with a frame around it.
entrySetHasFrame :: EntryClass self => self -> Bool -> IO ()
Sets whether the entry has a beveled frame around it.
entryGetWidthChars
:: EntryClass self |
=> self |
-> IO Int | returns number of chars to request space for, or negative if unset
Gets the value set by `entrySetWidthChars`.
entrySetWidthChars
:: EntryClass self |
=> self |
-> Int | `nChars` - width in chars
-> IO () |
Changes the size request of the entry to be about the right size for `nChars` characters. Note that it changes the size request, the size can still be affected by how you pack the widget into containers. If `nChars` is -1, the size reverts to the default entry size. 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.
entrySetAlignment
:: EntryClass self |
=> self |
-> Float | `xalign` - The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts
-> IO () |
Sets the alignment for the contents of the entry. This controls the horizontal positioning of the contents when the displayed text is shorter than the width of the entry. Available since Gtk version 2.4
entryGetAlignment
:: EntryClass self |
=> self |
-> IO Float | returns the alignment
Gets the value set by `entrySetAlignment`. Available since Gtk version 2.4
entrySetCompletion :: EntryClass self => self -> EntryCompletion -> IO ()
Sets the auxiliary completion object to use with the entry. All further configuration of the completion mechanism is done on completion using the `EntryCompletion` API. Available since Gtk version 2.4
entryGetCompletion
:: EntryClass self |
=> self |
-> IO EntryCompletion | returns The auxiliary completion object currently in use by `entry`.
Returns the auxiliary completion object currently in use by the entry. Available since Gtk version 2.4
Attributes
entryCursorPosition :: EntryClass self => ReadAttr self Int
The current position of the insertion cursor in chars. Allowed values: [0,65535] Default value: 0
entrySelectionBound :: EntryClass self => ReadAttr self Int
The position of the opposite end of the selection from the cursor in chars. Allowed values: [0,65535] Default value: 0
entryEditable :: EntryClass self => Attr self Bool
Whether the entry contents can be edited. Default value: `True`
entryMaxLength :: EntryClass self => Attr self Int
Maximum number of characters for this entry. Zero if no maximum. Allowed values: [0,65535] Default value: 0
entryVisibility :: EntryClass self => Attr self Bool
`False` displays the "invisible char" instead of the actual text (password mode). Default value: `True`
entryHasFrame :: EntryClass self => Attr self Bool
`False` removes outside bevel from entry. Default value: `True`
entryInvisibleChar :: EntryClass self => Attr self Char
The character to use when masking entry contents (in "password mode"). Default value: '*'
entryActivatesDefault :: EntryClass self => Attr self Bool
Whether to activate the default widget (such as the default button in a dialog) when Enter is pressed. Default value: `False`
entryWidthChars :: EntryClass self => Attr self Int
Number of characters to leave space for in the entry. Allowed values: >= -1 Default value: -1
entryScrollOffset :: EntryClass self => ReadAttr self Int
Number of pixels of the entry scrolled off the screen to the left. Allowed values: >= 0 Default value: 0
entryText :: EntryClass self => Attr self String
The contents of the entry. Default value: ""
entryXalign :: EntryClass self => Attr self Float
The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts. Allowed values: [0,1] Default value: 0
entryAlignment :: EntryClass self => Attr self Float
'alignment' property. See `entryGetAlignment` and `entrySetAlignment`
entryCompletion :: EntryClass self => Attr self EntryCompletion
'completion' property. See `entryGetCompletion` and `entrySetCompletion`
Signals
onEntryActivate :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
afterEntryActivate :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
Emitted when the user presses return within the `Entry` field.
onCopyClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
afterCopyClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
Emitted when the current selection has been copied to the clipboard.
onCutClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
afterCutClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
Emitted when the current selection has been cut to the clipboard.
onPasteClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
afterPasteClipboard :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
Emitted when the current selection has been pasted from the clipboard.
onToggleOverwrite :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
afterToggleOverwrite :: EntryClass ec => ec -> IO () -> IO (ConnectId ec)
Emitted when the user changes from overwriting to inserting.
Produced by Haddock version 2.7.2