On Wednesday, March 23, 2022 at 11:13:18 AM UTC-4 [email protected] wrote:
> It's my primary IDE these days, and I've written quite a few 'LApps'
> (leo-apps) that live inside their own outlines for various tasks --
> effectively custom tools. Leo is pretty central to how I interact with
> data and organize information. It's a grand tool.
>
I learned about another terrific feature just a few weeks ago that will
whet your appetite if you don't know about it already. Say you want to
write a mini-application, and it should write to some display, and not to
one of Leo's standard panels. So you would want to construct a custom
widget, but how to use it in practice? Making a plugin and getting it into
the splitter is tricky, especially if you haven't done it before, and
there's a degree of boilerplate, etc.
Turns out that you can create a new tab for it in the log pane with almost
no effort. That's how those tabs like Find, Spell, Nav, etc are handled.
I was able to adapt my viewrendered3 plugin into a non-plugin tab in about
15 minutes at most. I have got a browser bookmark manager running in its
own tab.
Basically you ask the tab manager to open a new tab that has your widget,
like this:
# Imports first
log = c.frame.log
log.selectTab('Your Tab', widget = yourWidget(c, g)) # or whatever args you
need
That's it! The tab manager handles all the layout, naming, etc,
technicalities for you. After you've got the tab, you can switch to it
programatically by calling selectTab()with its tab name, omitting the
widget.
--
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/a2672a3f-ec7b-49ae-8951-243cc46f6415n%40googlegroups.com.