From: Duncan C. <dun...@wo...> - 2006-10-21 19:56:13
|
On Sat, 2006-10-21 at 13:21 -0400, Pete Kazmier wrote: > I'm a newbie to GUI, GTK, and Haskell, so please bear with me :-) I > am having a hard time accessing the original data in my TreeList. > When a row is activated, I want access to the original row data in my > model. I can't seem to get there using TreePath which is supplied in > the callback to onRowActivated. I'd be happy to just display the item > clicked into the status bar for starters. Here is my code: Actually, both the new list and tree stores are unfinished in this respect. You can insert and modify data and connect it to a view but we've not added the methods to get the data out. This shouldn't be too hard to add and we need to do this before the next release anyway of course. Axel: if you want to do the tree one I'll do the list one. :-) In the mean time, it is actually possible to get the data using the old API for that bit. You'd need to use treeModelGetIter to turn the path into an iter, then you can use treeModelGetValue to get the value from the right column as a 'GenericValue', from which you can get the String. Yeah, what a pain. That's the kind of complexity we're trying to avoid with the new api. So we should just get on and finish the new api. Duncan |