From: Duncan C. <dun...@wo...> - 2006-10-22 13:17:35
|
On Sun, 2006-10-22 at 13:53 +0100, Axel Simon wrote: > On Sat, 2006-10-21 at 20:49 +0100, Duncan Coutts wrote: > > 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. :-) > > That sounds like a plan. We only need something like extracting a node > and replacing a node, right? For trees, I would probably need "replace > the datum in one node" and "replace node" where the latter creates an > update signal to the view for all children while the former doesn't. Right. You've already got treeStoreChange which updates the data in one node. Yes, I think you want a different one to replace the node and all its children. Similarly for get, you've got treeStoreGet which gets the forest at the root. Perhaps we want treeStoreGet to get just one node at a given path and treeStoreGetSubTree (or something) to get a Tree / Forest. Or perhaps for consistency with the existing store/model apis we want thingStore(Get|Set|Update)Value for the ones that modify a single value. The list store would only have these versions of course. Then use thingStore(Get|Set|Update)Node or perhaps Tree/SubTree. Not sure about that one, can you think of something sensible? > Also, I should remove my name from the TreeStore. The other one is called ListStoreNew, not sure that's ideal either :-) We're not going to replace the old store modules for this release so our news ones need to be called something different. I guess "New" isn't that bad. Duncan |