In conversation with Rebecca last night at dinner I saw more clearly what the next step is.
*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*. *The problem* The npyscreen code (including subclasses in cursesGui2.py), uses a tree of LeoTreeData nodes. This tree is completely separate from the tree of vnodes that Leo uses. Some way must be found to use Leo's positions/vnodes *in the npyscreen code*. That is, the npyscreen code must get the (contents of) a vnode when drawing the screen or when changing the outline. *The solution* The solution will be to create an interface that "stands in" for the MultiLine._my_widgets array, or maybe some other array. This is *the switcheroo*. Ideally, the npyscreen code will know *nothing* about the switcheroo. The stand-in class will use special (__xxx__) methods (aka dunder methods) to simulate array access. *Complications!* The MLTree tree handlers for insert/delete/expand/contract nodes must call Leo's own tree-handling methods, which will then, when calling c.redraw, cause the npyscreen outline to be updated. 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. I'm not going to stupefy you, dear reader, with the details. It's not even clear where the switcheroo will happen. It may involve the _contained_widgets ivar (another list) of some class rather than MultiLine._my_widgets list. *Summary* I am pretty sure I know the general way forward, but I have no idea where the complications will take me. Ideally, the npyscreen code will be unaware of the switcheroo and can be used unchanged, but I'll override npyscreen methods if need be. 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.
