On Monday, May 15, 2017 at 10:28:49 AM UTC-5, Edward K. Ream wrote:

*> tl;dr:* We need an interface *class *that delivers (wrappers to) Leo's 
position and/or vnode classes instead of some (as yet unknown) npyscreen 
*array*.
...
> But oh my, the complications involved in the switcheroo itself are 
mind-boggling. I have been studying the code for days, trying to understand 
every little wrinkle.

It's never a good idea to "predict" difficulties, or to dwell on 
complications. My previous strategy of studying *all *the sources was 
inefficient. There is no need to do that! Instead, tracing the *name* of a 
method reveals the method (in whatever superclass!) that will actually be 
called.

For example, LeoMLTree.delete_line isn't working.  The line *appears* to be 
deleted from the screen, but collapsing and expanding the deleted node's 
parent shows the deleted node again.  This bug is directly related to the 
_my_widgets and the switcheroo, so I want to fix it asap.

The LeoMLTree.delete_line sources give no indications of the class to which 
self.display refers.  No problem! Just add g.trace(self.display). The 
result will be:

    <bound method Widget.display of <leo.plugins.cursesGui2.LeoMLTree 
object at 0x086E7B10>>

So now we know that *Widget*.display is being executed, not the display 
method of any other class. This trick saves a lot of sleuthing. No need for 
a debugger, which is how I previously discovered the actual method being 
called.

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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to