Here are my findings, *I did most of my testing with ONLY my plugin enabled*
:

The relevant code from leo\plugins\qt_tree.py:

    def onIconBoxDoubleClick (self,event,p=None):
        if self.busy(): return

        c = self.c
        if not p: p = c.p

        if not g.doHook("icondclick1",c=c,p=p,v=p,event=event):
            self.endEditLabel()
            self.OnIconDoubleClick(p) # Call the method in the base class.

        g.doHook("icondclick2",c=c,p=p,v=p,event=event)

        c.outerUpdate()
 
and

if p:
            # 2014/02/21: generate headddlick1/2 instead of icondclick1/2.
            event = None
            if g.doHook("headdclick1",c=c,p=p,v=p,event=event) is None:
                c.frame.tree.OnIconDoubleClick(p) # Call the base class 
method.
            g.doHook("headclick2",c=c,p=p,v=p,event=event)

I'm not sure why icondclick1/2 aren't working but *headdclick1 is working 
for me*. However, it doesn't seem to produce expected behavior. For example 
if I double click on any part of the Node headline the first time it calls 
the headdclick1 handler. After the first time I have to click in the box, 
I'm sure this is not the intended behavior.

Additionally, if I enable my plugin as listed above ahead of todo.py I get 
this error:

Traceback (most recent call last):
  File "C:\MyPrograms\leo-editor-master\leo\plugins\qt_tree.py", line 514, 
in on ContextMenu
    h(c,p,menu)
  File "C:\MyPrograms\leo-editor-master\leo\plugins\todo.py", line 102, in 
popup_entry
    c.cleo.addPopupMenu(c,p,menu)
AttributeError: 'Commands' object has no attribute 'cleo' 

Which is interesting. I know todo.py can mess around with that whole icon 
area to the left of the headline so I am wondering if it has anything to do 
with that.

That's all for now... sorry to be a nuisance.

On Tuesday, March 17, 2015 at 12:44:57 PM UTC-4, Terry Brown wrote:
>
> On Tue, 17 Mar 2015 09:57:43 -0500 
> "Edward K. Ream" <[email protected] <javascript:>> wrote: 
>
> > On Tue, Mar 17, 2015 at 7:31 AM, john lunzer <[email protected] 
> <javascript:>> wrote: 
> > 
> > ​Thanks for this detailed report. 
>
> For some odd reason I seem to be missing the originals of some posts. 
>
> Anyway, I suspect some of those hooks might not work since the Tk 
> interface went away.  It would probably be good to have a set of 
> testing specifically covering the table at 
> http://leoeditor.com/scripting.html#event-handlers 
> although I'm not sure if all of them can be tested automatically vs. 
> requiring a manual test. 
>
> Cheers -Terry 
>
> > Maybe I'm misunderstanding something. The icon is the box to the left 
> > of the headline? I'm not just being an idiot? I know that the plugin 
> > is loading being the print and g.es statements from init() and 
> > onCreate() are executing. 
> > 
> > ​The icon *box* is to the left of the headline.  Icons go to the 
> > right of the icon box.  The todo.py plugin shows that icons can be 
> > inserted. 
> > 
> > I suggest looking at todo.py to see how it works. 
> > 
> > ​> ​ 
> > I broke the cardinal rule and tried for a couple hours to diagnose 
> > this myself without asking. 
> > 
> > ​Hehe.  I break this rule all the time ;-) 
> > 
> > I'm not sure what the problem is.  Anyone else know? 
> > 
> > ​ 
> > ​ 
> > ​Edward 
> > 
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to