[Gtk-sharp-list] TreeStore saving state

Andrew York andy at brdstudio.net
Sat Aug 2 08:40:59 EDT 2008


I've gotten fairly comfortable with Gtk# and it's TreeStore over the 
last few months, but I still have not figured out a good way to save the 
state of the TreeStore. Specifically when storing the values from a 
TreeStore into a database what is the best way to be sure that all the 
rows wind up with the correct parent/child relationship when querying 
the data back out of the database.

My first thought was to use the TreeIter stamp but that didn't work out 
at all, maybe due to my lack of knowledge. More recently I have been 
working with the TreePath which works well if you never filter there 
query results which will give you duplicate paths when you update the 
database again, definitely not a unique identifier. My most resent 
thoughts are on possibly putting together the unique ids from the 
database in a chain like the path does with the rows position. I'm 
really not sure that is a good idea either.

So the question is... in your opinion what is the best way to save the 
values from a TreeStore in a database and retrieve them again through 
SQL and maintain the intended parent/child relationship.

This maybe simple and I just missed it.
Thanks for your help
Andy




More information about the Gtk-sharp-list mailing list