| Gtk2Hs | Contents | Index

Graphics.UI.Gtk.MenuComboToolbar.ComboBoxEntry

Portability | portable (depends on GHC)
Stability | provisional
Maintainer | gtk2hs-users@lists.sourceforge.net

Contents

Detail
Class Hierarchy
Types
Constructors
Methods
Attributes

Description

A text entry field with a dropdown list

- Module available since Gtk+ version 2.4

Synopsis

data ComboBoxEntry
class ComboBoxClass o => ComboBoxEntryClass o
castToComboBoxEntry :: GObjectClass obj => obj -> ComboBoxEntry
toComboBoxEntry :: ComboBoxEntryClass o => o -> ComboBoxEntry
comboBoxEntryNew :: IO ComboBoxEntry
comboBoxEntryNewText :: IO ComboBoxEntry
comboBoxEntryNewWithModel :: TreeModelClass model => model -> IO ComboBoxEntry
comboBoxEntrySetModelText :: ComboBoxEntryClass self => self -> IO (ListStore String)
comboBoxEntrySetTextColumn :: ComboBoxEntryClass self => self -> ColumnId row String -> IO ()
comboBoxEntryGetTextColumn :: ComboBoxEntryClass self => self -> IO (ColumnId row String)
comboBoxEntryGetActiveText :: ComboBoxEntryClass self => self -> IO (Maybe String)
comboBoxEntryTextColumn :: ComboBoxEntryClass self => Attr self (ColumnId row String)

Detail

A `ComboBoxEntry` is a widget that allows the user to choose from a list of valid choices or enter a different value. It is very similar to a `ComboBox`, but it displays the selected value in an entry to allow modifying it.

In contrast to a `ComboBox`, the underlying model of a `ComboBoxEntry` must always have a text column (see `comboBoxEntrySetTextColumn`), and the entry will show the content of the text column in the selected row. To get the text from the entry, use `comboBoxEntryGetActiveText`.

The `changed` signal will be emitted while typing into a `ComboBoxEntry`, as well as when selecting an item from the ComboBoxEntry's list. Use `comboBoxGetActive` or `comboBoxGetActiveIter` to discover whether an item was actually selected from the list.

Connect to the activate signal of the `Entry` (use binGetChild) to detect when the user actually finishes entering text.

Class Hierarchy

     |  GObject
     |   +----Object
     |         +----Widget
     |               +----Container
     |                     +----Bin
     |                           +----ComboBox
     |                                 +----ComboBoxEntry

Types
data ComboBoxEntry

Instances

GObjectClass ComboBoxEntry
CellLayoutClass ComboBoxEntry
ComboBoxEntryClass ComboBoxEntry
ComboBoxClass ComboBoxEntry
BinClass ComboBoxEntry
ContainerClass ComboBoxEntry
WidgetClass ComboBoxEntry
ObjectClass ComboBoxEntry

class ComboBoxClass o => ComboBoxEntryClass o

Instances

ComboBoxEntryClass ComboBoxEntry

castToComboBoxEntry :: GObjectClass obj => obj -> ComboBoxEntry
toComboBoxEntry :: ComboBoxEntryClass o => o -> ComboBoxEntry
Constructors
comboBoxEntryNew :: IO ComboBoxEntry
Creates a new `ComboBoxEntry` which has a `Entry` as child. After construction, you should set a model using `comboBoxSetModel` and a text column using `comboBoxEntrySetTextColumn`.
comboBoxEntryNewText :: IO ComboBoxEntry
Creates a new `ComboBoxEntry` with a store containing strings. See `comboBoxEntrySetModelText`.
comboBoxEntryNewWithModel

:: TreeModelClass model |
=> model | `model` - A `CustomStore`.
-> IO ComboBoxEntry |
Creates a new `ComboBoxEntry` which has a `Entry` as child and a list of strings as popup. You can get the `Entry` from a `ComboBoxEntry` using binGetChild. To add and remove strings from the list, just modify `model` using its data manipulation API.

Methods
comboBoxEntrySetModelText :: ComboBoxEntryClass self => self -> IO (ListStore String)

Set a model box that holds strings.

This function stores a Graphics.UI.Gtk.ModelView.ListStore with the widget and sets the model to the list store. The widget can contain only strings. The model can be retrieved with `comboBoxGetModel`. The list store can be retrieved with `comboBoxGetModelText`. Any exisiting model or renderers are removed before setting the new text model. In order to respond to new texts that the user enters, it is necessary to connect to the Graphics.UI.Gtk.Entry.Entry.entryActivate signal of the contained Graphics.UI.Gtk.Entry.Entry.Entry an insert the text into the text model which can be retrieved with `comboBoxGetModelText`. Note that the functions `comboBoxAppendText`, `comboBoxInsertText`, `comboBoxPrependText`, `comboBoxRemoveText` and `comboBoxGetActiveText` can be called on a combo box only once `comboBoxEntrySetModelText` is called.

comboBoxEntrySetTextColumn

:: ComboBoxEntryClass self |
=> self |
-> ColumnId row String | `textColumn` - A column in `model` to get the strings from.
-> IO () |
Sets the model column should be use to get strings from to be `textColumn`.

comboBoxEntryGetTextColumn

:: ComboBoxEntryClass self |
=> self |
-> IO (ColumnId row String) | returns A column in the data source model of `entryBox`.
Returns the column which is used to get the strings from.

comboBoxEntryGetActiveText :: ComboBoxEntryClass self => self -> IO (Maybe String)

Retrieve the text currently in the entry.

- Returns `Nothing` if no text is selected or entered.
- Availabe in Gtk 2.6 or higher.

Attributes
comboBoxEntryTextColumn :: ComboBoxEntryClass self => Attr self (ColumnId row String)
A column in the data source model to get the strings from. Allowed values: >= 0 Default value: Graphics.UI.Gtk.ModelView.CustomStore.invalidColumnId
Produced by Haddock version 2.4.2