Hi Rouan, On 30.08.2012, at 11:04, Rouan van Dalen wrote:
> Hi Everyone, > > I need to get the selected item from my TreeView, which is using a > ListStore model. > The model is not just a String, it is a list of records with a few > fields. > > After googling a bit it seems that there is no way to get a > ListStore model > from a TreeModel. > You mean "a ListStore from a TreeView"? A ListStore is a Haskell instance of the C TreeModel type. > Has this been fixed. The code at: > http://haskellwiki.gitit.net/Gtk2Hs/Tutorials/TreeView > states in the comments that this was a problem. > > I would not like to pass around the model with the TreeView if > possible. I want to > get the model from the TreeView and retrieve the selected item from > that model. > If we would allow you to extract a 'ListStore MyType' from a 'TreeView' then there is no way we can ensure that the view actually contains a store over MyType. Thus, for the sake of type safety, we has to omit this route. You can extract an untyped TreeModel from a TreeView, but then you're limited to the functions in TreeModel (that don't allow you to access the actual data). I'm afraid the only way is to store the model separately in your program. Cheers, Axel > Regards > > Rouan. > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. > Discussions > will include endpoint security, mobile security and the latest in > malware > threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ > Gtk2hs-devel mailing list > Gtk2hs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Gtk2hs-devel mailing list Gtk2hs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel