On Wed, Aug 26, 2020 at 11:19 AM vitalije <[email protected]> wrote:

> Now, regarding the initial problem (I believe it was about
expanded/collapsed state of nodes)...The simplest possible solution will be
just to delegate the p.isExpanded method to the GUI and find the
corresponding tree item and ask it if it is expanded or not.

This could be a good idea.

> For example:
g.app.gui.isExpanded(p) # or c.frame.tree.isExpanded(p)
# instead of
p.isExpanded()

p.isExpanded could just call g.app.gui.isExpanded(p). Similarly, to
preserve the existing api, p.expand() and p.contract() could call
corresponding g.app.gui methods.

The point is that there is always a two-way interaction between Leo's api's
(based on positions or vnodes) and the gui. Having the gui be responsible
for the "real" expanded bit is feasible. The expanded bit could go away in
the vnode and position classes. Leonine scripts could still determine
whether any node/position is expanded.

> IMHO the most natural place to store the expanded/collapsed bit about
outline node is in the GUI/View. Also rethinking positions and their
methods might be beneficial.

This certainly merits further consideration. Let me consider your overall
post further.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS0k1NBxEznV0xwf4yJ2AKt0_JRaqQ%3DyVMHBM%3DhbTtnGfg%40mail.gmail.com.

Reply via email to