On Tue, Jun 10, 2008 at 5:36 PM, Edward K. Ream <[EMAIL PROTECTED]> wrote:

> Ville, you are completely misunderstanding the task at hand.  The task
> is not to duplicate the Tk code, which is *extremely* complex.  The
> task is to implement c.frame.tree.redraw_now.  How you do that is up
> to you.  If the gui supports a capable tree widget, the obvious first
> choice is to let the tree widget do as much of the work as possible.

Ah, *now* we are talking.

I don't think there is any code that needs to be written to implement
tree redraw because most tree widgets should handle that
automatically.

This should be almost trivial. Here's how I did it in qleolite
(http://bazaar.launchpad.net/~villemvainio/leo-editor/qleolite/files):

55     def populate_tree(self, parent=None):
56                      """ Render vnodes in tree """
57              
58                      for p in c.allNodes_iter():
59                          parent = self.items.get(p.parent().v,  
self.treeWidget)
60                          it = QTreeWidgetItem(parent)
61                          self.items[p.v] = it
62                          self.treeitems[it] = p.t
63                          it.setText(0, p.headString())

Of course we would need to add icons as well, but that is trivial as well.

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to leo-editor@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to