| ||||||||||
| ||||||||||
| ||||||||||
Description | ||||||||||
Completion functionality for Entry
| ||||||||||
Synopsis | ||||||||||
Detail | ||||||||||
EntryCompletion is an auxiliary object to be used in conjunction with Entry to provide the completion functionality. It implements the CellLayout interface, to allow the user to add extra cells to the TreeView with completion matches. "Completion functionality" means that when the user modifies the text in the entry, EntryCompletion checks which rows in the model match the current content of the entry, and displays a list of matches. By default, the matching is done by comparing the entry text case-insensitively against the text in a model (see Graphics.UI.Gtk.Entry.entryCompletionSetTextModel), but this can be overridden with a custom match function (see entryCompletionSetMatchFunc). When the user selects a completion, the content of the entry is updated. By default, the content of the entry is replaced by the text column of the model, but this can be overridden by connecting to the matchSelected signal and updating the entry in the signal handler. Note that you should return True from the signal handler to suppress the default behaviour. To add completion functionality to an entry, use Graphics.UI.Gtk.Entry.Entry.entrySetCompletion. In addition to regular completion matches, which will be inserted into the entry when they are selected, EntryCompletion also allows to display "actions" in the popup window. Their appearance is similar to menu items, to differentiate them clearly from completion strings. When an action is selected, the completionActionActivated signal is emitted. | ||||||||||
Class Hierarchy | ||||||||||
| GObject | +----EntryCompletion | ||||||||||
Types | ||||||||||
data EntryCompletion | ||||||||||
| ||||||||||
class GObjectClass o => EntryCompletionClass o | ||||||||||
| ||||||||||
castToEntryCompletion :: GObjectClass obj => obj -> EntryCompletion | ||||||||||
gTypeEntryCompletion :: GType | ||||||||||
toEntryCompletion :: EntryCompletionClass o => o -> EntryCompletion | ||||||||||
Constructors | ||||||||||
entryCompletionNew :: IO EntryCompletion | ||||||||||
Creates a new EntryCompletion object. | ||||||||||
Methods | ||||||||||
entryCompletionGetEntry | ||||||||||
| ||||||||||
entryCompletionSetModel | ||||||||||
| ||||||||||
entryCompletionGetModel | ||||||||||
| ||||||||||
entryCompletionSetTextModel | ||||||||||
| ||||||||||
entryCompletionSetMatchFunc :: EntryCompletion -> (String -> TreeIter -> IO Bool) -> IO () | ||||||||||
Sets the match function for completion to be func. The match function is used to determine if a row should or should not be in the completion list.
| ||||||||||
entryCompletionSetMinimumKeyLength | ||||||||||
| ||||||||||
entryCompletionGetMinimumKeyLength | ||||||||||
| ||||||||||
entryCompletionComplete :: EntryCompletion -> IO () | ||||||||||
Requests a completion operation, or in other words a refiltering of the current list with completions, using the current key. The completion list view will be updated accordingly. | ||||||||||
entryCompletionInsertActionText | ||||||||||
| ||||||||||
entryCompletionInsertActionMarkup | ||||||||||
| ||||||||||
entryCompletionDeleteAction | ||||||||||
| ||||||||||
entryCompletionSetTextColumn | ||||||||||
| ||||||||||
entryCompletionInsertPrefix :: EntryCompletion -> IO () | ||||||||||
Requests a prefix insertion.
| ||||||||||
entryCompletionGetTextColumn | ||||||||||
| ||||||||||
entryCompletionSetInlineCompletion | ||||||||||
| ||||||||||
entryCompletionGetInlineCompletion | ||||||||||
| ||||||||||
entryCompletionSetPopupCompletion | ||||||||||
| ||||||||||
entryCompletionGetPopupCompletion | ||||||||||
| ||||||||||
entryCompletionSetPopupSetWidth | ||||||||||
| ||||||||||
entryCompletionGetPopupSetWidth | ||||||||||
| ||||||||||
entryCompletionSetPopupSingleMatch | ||||||||||
| ||||||||||
entryCompletionGetPopupSingleMatch | ||||||||||
| ||||||||||
Attributes | ||||||||||
entryCompletionModel :: TreeModelClass model => ReadWriteAttr EntryCompletion (Maybe TreeModel) (Maybe model) | ||||||||||
The model to find matches in. | ||||||||||
entryCompletionMinimumKeyLength :: Attr EntryCompletion Int | ||||||||||
Minimum length of the search key in order to look up matches. Allowed values: >= 0 Default value: 1 | ||||||||||
entryCompletionTextColumn :: Attr EntryCompletion (ColumnId row String) | ||||||||||
The column of the model containing the strings. Default value: Graphics.UI.Gtk.ModelView.CustomStore.invalidColumnId | ||||||||||
entryCompletionInlineCompletion :: Attr EntryCompletion Bool | ||||||||||
Determines whether the common prefix of the possible completions should be inserted automatically in the entry. Note that this requires text-column to be set, even if you are using a custom match function. Default value: False | ||||||||||
entryCompletionPopupCompletion :: Attr EntryCompletion Bool | ||||||||||
Determines whether the possible completions should be shown in a popup window. Default value: True | ||||||||||
entryCompletionPopupSetWidth :: Attr EntryCompletion Bool | ||||||||||
Determines whether the completions popup window will be resized to the width of the entry. Default value: True | ||||||||||
entryCompletionPopupSingleMatch :: Attr EntryCompletion Bool | ||||||||||
Determines whether the completions popup window will shown for a single possible completion. You probably want to set this to False if you are using inline completion. Default value: True | ||||||||||
Signals | ||||||||||
insertPrefix :: EntryCompletionClass self => Signal self (String -> IO Bool) | ||||||||||
Gets emitted when the inline autocompletion is triggered. The default behaviour is to make the entry display the whole prefix and select the newly inserted part. Applications may connect to this signal in order to insert only a smaller part of the prefix into the entry - e.g. the entry used in the FileChooser inserts only the part of the prefix up to the next '/'.
| ||||||||||
completionActionActivated :: EntryCompletionClass self => Signal self (Int -> IO ()) | ||||||||||
Gets emitted when an action is activated. | ||||||||||
matchSelected :: EntryCompletionClass self => Signal self (TreeModel -> TreeIter -> IO Bool) | ||||||||||
Gets emitted when a match from the list is selected. The default behaviour is to replace the contents of the entry with the contents of the text column in the row pointed to by iter. | ||||||||||
Deprecated | ||||||||||
onInsertPrefix :: EntryCompletionClass self => self -> (String -> IO Bool) -> IO (ConnectId self) | ||||||||||
afterInsertPrefix :: EntryCompletionClass self => self -> (String -> IO Bool) -> IO (ConnectId self) | ||||||||||
Gets emitted when the inline autocompletion is triggered. The default behaviour is to make the entry display the whole prefix and select the newly inserted part. Applications may connect to this signal in order to insert only a smaller part of the prefix into the entry - e.g. the entry used in the FileChooser inserts only the part of the prefix up to the next '/'. | ||||||||||
onActionActivated :: EntryCompletionClass self => self -> (Int -> IO ()) -> IO (ConnectId self) | ||||||||||
afterActionActivated :: EntryCompletionClass self => self -> (Int -> IO ()) -> IO (ConnectId self) | ||||||||||
Gets emitted when an action is activated. | ||||||||||
Produced by Haddock version 2.4.2 |