On Fri, 14 May 2010 10:16:24 +0300
"Ville M. Vainio" <vivai...@gmail.com> wrote:

> > colorize_headlines.py is a good example, but it's called in the wrong
> > place for changing the text.  
> 
> Are you sure? If it changes text, does it get overwritten?

Yes, it's called from

Qt gui-->@thin qtGui.py-->Frame and component classes...-->class leoQtTree 
(baseNativeTree)-->Widget-dependent helpers (leoQtTree)-->Items-->createTreeItem

but createTreeItem is called from

Qt gui-->@thin baseNativeTree.py-->Drawing... (nativeTree)-->full_redraw & 
helpers-->drawNode

like this:

    # Allocate the item.
    item = self.createTreeItem(p,parent_item) 

    # Do this now, so self.isValidItem will be true in setItemIcon.
    self.rememberItem(p,item)

    # Set the headline and maybe the icon.
    self.setItemText(item,p.h)
    if p:
        self.drawItemIcon(p,item)

    if trace: g.trace(self.traceItem(item))

so perhaps the hook could just be moved to be after the 
'self.drawItemIcon(p,item)', which would let it monkey with everything.  OTOH, 
maybe there should be three separate hooks, so you can interfere with the text, 
the icons, and the styling, but in such a way that the regular code isn't 
executed if you're going to discard it anyway.

Cheers -Terry

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

Reply via email to