Question about frame, body and wrapper

27 views
Skip to first unread message

Félix

unread,
Sep 28, 2020, 5:23:30 PM9/28/20
to leo-editor
Apologies in advance if this seems like a silly question.. I'm trying some stuff out for my "issue 39" and re-write of my body-handler in general and I was wondering :

Leo does keep a different instance of frame, body and wrapper instead of reusing the same when switching from one opened document to the other by using tabs at the top right?

Meaning that It does not 're-use' the same ones (and just rapidly change their contents and widths / scroll positions when switching) ,but instead it hides and shows each one accordingly, right?

I've inspected those in the debugger, and they seem distinct, but I just wanted to make sure...

--
Félix

Edward K. Ream

unread,
Sep 29, 2020, 6:23:34 AM9/29/20
to leo-editor
On Mon, Sep 28, 2020 at 4:23 PM Félix <felix...@gmail.com> wrote:
I'm trying some stuff out for my "issue 39" and re-write of my body-handler in general and I was wondering :

Leo does keep a different instance of frame, body and wrapper instead of reusing the same when switching from one opened document to the other by using tabs at the top right?

Correct. c.frame, c.frame.body, c.frame.tree, c.frame.log, etc. all change when c.changes. And c changes when switching outlines.

Meaning that It does not 're-use' the same ones (and just rapidly change their contents and widths / scroll positions when switching) ,but instead it hides and shows each one accordingly, right?

Yes, I think so. I had to think for awhile how this all works.

The very gory details are in the all-important tree.select method of the base LeoTree class. Also, c.redraw is involved. The point is that tree.select handles the very tricky details of switch c and all the rest, while c.redraw redraws c's tree, not some global, generic tree.

I've inspected those in the debugger, and they seem distinct, but I just wanted to make sure...

Another way would be to do g.trace(id(x)) where x could be c, c.body, etc.

Edward

Félix

unread,
Sep 29, 2020, 1:38:05 PM9/29/20
to leo-editor
Great! Thanks for those clarifications!
Reply all
Reply to author
Forward
0 new messages