[Gtk-sharp-list] Query all values from TreeView

LordPhoenix lordphoenix at free.fr
Thu Jul 8 03:09:46 EDT 2010


Le Wed, 7 Jul 2010 08:12:31 -0700 (PDT),
MethodCZ <methodcz at gmail.com> a écrit :

> 
> Hi,
> 
> In the morning i didn't think it will be necessary to ask here,
> however after all day which i spent trying to figure how to get
> values from my TreeView, i'm kinda hopeless.
> 
> My problem is that i have have a TreeView with Model and everything
> required where user can add/remove nodes. (it's actually only one
> level of nodes so it's not really tree). User can add multiple nodes.
> This is ok and i had no problem to wrote that. Problem is that i need
> to join all the values of all the nodes into one single string
> variable. (My treeview has only 1 column)
> 
> So for example user adds values "a", "b", "c" and i want to join it
> into string val = "abc".
> 
> I did some research on this and found few ideas how to do this from
> using TreeModel.Foreach function to some suggestions to use Do cycle
> etc. but none of them worked :{
> 
> Thanks for any ideas :]

Here is my way to browse ListStore:

TreeIter iter;
if(ListStore.GetIterFirst(out iter)){
	do{
	myvalue = ListStore.GetValue(iter,column);
	//make treatment on myvalue.
	while(ListStore.NextIter(ref iter));
	}
}

Can do same way with TreeStore I think.

PS: Sorry for my bad English I don't speak it very often.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20100708/1f9e7257/attachment.bin 


More information about the Gtk-sharp-list mailing list