This sounds pretty much what I had in mind.  The freewin plugin actually 
does the same (in its own separate window). VR/VR3 also replace the 
rendering widget type depending on what is to be rendered.  Currently VR3 
can optionally render to a tab in the log frame instead of to a new frame 
within the overall Leo window.  So we're not far off.

On Thursday, April 25, 2024 at 8:37:59 AM UTC-4 [email protected] wrote:

> 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 <[email protected]> wrote:
>
>>
>>
>> On Thu, Apr 25, 2024 at 6:57 AM Thomas Passin <[email protected]> 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 [email protected].
>> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/2903cdcc-8f76-456a-9723-f448afecba32n%40googlegroups.com.

Reply via email to