Sun Feb 1 16:55:14 EST 2009 Axe...@en...
* Add another function to the simple text API for combo boxes. Correct documentation. Due to Peter Hercek.
hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/ComboBox.chs.pp 85
+ comboBoxGetActiveText,
hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/ComboBox.chs.pp 170
- listStoreInsert, listStorePrepend, listStoreAppend, listStoreRemove )
+ listStoreInsert, listStorePrepend, listStoreAppend, listStoreRemove,
+ listStoreGetValue )
hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/ComboBox.chs.pp 220
--- widget that contains only strings. This model is also returned when calling
--- 'comboBoxGetModel'. Note that only the functions 'comboBoxAppendText',
--- 'comboBoxInsertText', 'comboBoxPrependText' and 'comboBoxRemoveText' should
--- be called on this widget once 'comboBoxSetModelText' is called. Any
--- exisiting model or renderers are removed before setting the new text model.
+-- 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.
+-- Note that the functions 'comboBoxAppendText', 'comboBoxInsertText',
+-- 'comboBoxPrependText', 'comboBoxRemoveText' and 'comboBoxGetActiveText'
+-- can be called on a combo box only once 'comboBoxSetModelText' is called.
hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/ComboBox.chs.pp 291
-
+-- | Returns the currently active string in @comboBox@ or @Nothing@ if none is
+-- selected. Note that you can only use this function with combo boxes
+-- constructed with 'comboBoxNewText'.
+--
+comboBoxGetActiveText :: ComboBoxClass self => self -> IO (Maybe String)
+comboBoxGetActiveText self = do
+ activeId <- comboBoxGetActive self
+ if activeId < 0
+ then return Nothing
+ else do
+ listStore <- comboBoxGetModelText self
+ value <- listStoreGetValue listStore activeId
+ return $ Just value
hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/ComboBoxEntry.chs.pp 148
--- This function stores a
--- 'Graphics.UI.Gtk.ModelView.ListStore' with the widget that contains only
--- strings. This model is also returned when calling 'comboBoxGetModel'. Note
--- that only the functions 'comboBoxAppendText', 'comboBoxInsertText',
--- 'comboBoxPrependText' and 'comboBoxRemoveText' should be called on this
--- widget once 'comboBoxSetModelText' is called. 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
+-- 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
hunk ./gtk/Graphics/UI/Gtk/MenuComboToolbar/ComboBoxEntry.chs.pp 159
+-- Note that the functions 'comboBoxAppendText', 'comboBoxInsertText',
+-- 'comboBoxPrependText', 'comboBoxRemoveText' and 'comboBoxGetActiveText'
+-- can be called on a combo box only once 'comboBoxEntrySetModelText' is
+-- called.
|