I actually implemented something similar in a private 'leoapp' (app that lives in a .leo file) I wrote for myself a few years back. Pretty simple to get done, IIRC.
My general pattern was to have a controller class that contained two 'view' widgets (a QTextBrowser for rendered HTML, and a QTextEdit for editing). The controller class had a wrapper widget that also had an 'edit' toggle button. When 'edit' is clicked, a callback is fired off to remove the active view widget and replace it with the new one (and set some state in the controller so it doesn't lose track of things). Content is updated between the two widgets whenever this swap happens. Internally they are two completely different objects, but to the user, the swap is fairly seamless. I did write this app relying on PyQt5, unfortunately, so I have a fair bit of updating to do if I want it to work on modern Leo. Ah well. Jake On Thu, Apr 25, 2024 at 8:10 AM Edward K. Ream <edream...@gmail.com> wrote: > > > On Thu, Apr 25, 2024 at 6:57 AM Thomas Passin <tbp100...@gmail.com> wrote: > >> Except that standard Leo nodes don't render graphics and other non-text >> items. That's a big difference. We get around it to a degree with VR/VR3. >> Hmm, instead of rendering those nodes in a separate frame as VR/VR3 does, >> we could overlay the rendering frame over the editing frame. We could >> switch in and out of rendering mode to allow editing. I bet that wouldn't >> be too hard. One way would be to use a 2-frame tabbed widget. Leo would >> then have no disadvantage compared with Trillium and its ilk, and would >> keep all of its advantages. >> >> Yowee! >> > > I'm interested. Let's see what you can do. > > 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 leo-editor+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/leo-editor/CAMF8tS2oz4FPGXyuztu8e%3DpA3_vLG3DCF2x24p1FM_kSrRPJKw%40mail.gmail.com > <https://groups.google.com/d/msgid/leo-editor/CAMF8tS2oz4FPGXyuztu8e%3DpA3_vLG3DCF2x24p1FM_kSrRPJKw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- 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 leo-editor+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAJ1i%2BSYFAmFbSQQ65BqL0C6fAGPLA16gjHp_g%3DzgLAJE5h-xMA%40mail.gmail.com.