Oh, I wasn't actually trying to offer a solution. I don't really understand what the nullTree class is there for. I just saw that the problem with the buttons occurred due to an earlier exception that got thrown because the redraw_after_head_changed method did not exist in nullTree. I didn't know what the method was supposed to do, so I just added it with a pass. This happened when loading the common buttons from leoSettings, so I think the qt plugin hadn't been loaded yet... I figured nullTree was like a stub class before a gui was loaded.
On Jan 25, 6:53 am, "Edward K. Ream" <[email protected]> wrote: > On Sun, Jan 25, 2009 at 1:27 AM, Jesse Aldridge > <[email protected]>wrote: > > > > > I fixed the problem with the buttons by adding: > > > def redraw_after_head_changed(self): > > pass > > > To the nullTree class. > > This seems like a dubious approach. nullTree is a subclass of leoTree. > leoTree.redraw_after_head_changed is simply self.c.redraw(). c.redraw is:: > > def redraw (self,p=None,setFocus=False): > c = self > if p: > # Update body pane and set c._currentPosition. > c.expandAllAncestors(p) # Redundant, but safe. > c.selectPosition(p) > else: > p = c.currentPosition() > c.expandAllAncestors(p) > > c.frame.tree.redraw(p) > if setFocus: c.treeFocusHelper() > > True, this does call c.frame.tree.redraw, but c.frame.tree is a nullTree, > and nullTree.redraw is simply a pass. > > So my guess is that the problem occurs in c.redraw before calling > c.frame.tree.redraw. Your proposed solution guts, in effect, all the code > in c.redraw. That does not seem like a good idea to me. > > Edward --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
