I have some older code GTK 1.x that does this. I have handlers for the tree_expand and tree_collapse, resize-column, and the select signals. Then I keep up with the state in a dictionary that I write out to a users preferences file. On start up, I read load the dictionary from the pref file then set the tree up accordingly. That way the expanded nodes, column sizes and the last selection can all be restored.
I do the same thing for the dialog size. On Sep 1, 2008, at 5:58 AM, Koch Máté wrote: > Hi All, > > I'm developing an application which has got a window with a treeView > widget. Inside this widget there is a multi-level tree structure (some > kind of pseudo-code, IF-THEN-ELSE branches inside each other). The > tree fills up from a database, and thereafter the user can edit it > (delete subtree, add leafs or subtrees). After any action, or a given > time interwall, the modifications are saved to the db, and the > structure is reloaded (this is inportant, because multiple users can > work on it in real-time). > My question is, that is there any easy way, to store the status of the > current look of the tree (I mean, which branches are expanded, which > are collapsed), and after the reloading, revert tis state as much as > possible? The problem is, that the reloaded structure is not exactly > the same, some leafs or subtrees are missing, or something is > inserted, but largest part of the tree is the same. > > Thank you for help, > best regards, > Mate Koch > > P.S: sorry, I sent my former message from wrong address > > -- > KOCH Mate > ......................... > HUNGARY, ELTE > V. grade > Phys. & CS.stud. > ......................... > skype: koch.mate > www: elmfiz.elte.hu/~koch > www2: studiokoch.hu/ > phone: +36 20 9795411 > room: 5.91 É. T. > ......................... > _______________________________________________ > pygtk mailing list [email protected] > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ -- Steve McClure [EMAIL PROTECTED] _______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
