From: Axel S. <Axe...@en...> - 2009-07-01 07:51:28
|
On Tue, 2009-06-30 at 20:59 +0200, Bernhard Lehnert wrote: > Am Montag, den 29.06.2009, 23:18 +0200 schrieb Axel Simon: > > Could you try using 'comboBoxSetModelText'? > > Easily, but not understand the type problem that arises from it: > > line 12: store <- listStoreNew ["foo", "bar", "baz"] > line 13: comboBoxModelText combo (Just store) > > > => test.hs:13:4 > Couldn't match expected type 'Maybe (ListStore [Char]) -> t' > against inferred type 'IO (ListStore String)' Ok, here you're using a different function (an attribute, use with 'set'). What I suggested to do was to use the "Simple Text API" which gives you combo boxes that only contain strings. To create one of these, you create a combo box and then you set a default model using 'comboBoxSetModelText'. The name of the latter is a bit confusing, I admit, since it creates a ListStore, hooks it up with the ComboBox. However, looking at the API again, the point is that you from then onwards only use the functions in ComboBox, namely the "Simple Text API". So: combo <- comboBoxNew comboBoxSetModelText combo mapM_ (comboBoxAppendText combo) ["foo", "bar", "baz"] Sorry about the confusion, I think it wasn't all clear in my head either. Cheers, Axel. |