Thanks for this Terry, it should be helpful to a lot of newcomers.

On Tuesday, April 28, 2015 at 9:47:59 AM UTC-4, Terry Brown wrote:
>
> On Tue, 28 Apr 2015 03:56:14 -0700 (PDT) 
> john lunzer <[email protected] <javascript:>> wrote: 
>
> > I'm trying to slosh through bookmarks.py and hack it up to give me my 
> > own plugin which can add a widget to a pane. 
> > 
> > I'm sure this isn't the best way to go about this and I was wondering 
> > if there was a minimal example to show how to achieve a plugin that 
> > can be added to a pane. I would be grateful for the help. 
>
> Regarding adding widgets and ignoring plugins, maximally minimal would 
> be: 
>
> from leo.core.leoQt import QtWidgets 
> w = QtWidgets.QSlider() 
> c.free_layout.get_top_splitter().addWidget(w) 
>
> Adds slider widget, probably on right hand side, not that noticeable, 
> you could miss it ;-) 
>
> w can be anything of course, a QWidget with a layout containing lots of 
> other widgets, for example. To make your widget addable from the super 
> secret right-click on the pane dividers context menu, you need to 
> implement the "provider" interface defined here: 
>
> file://{{g.getBaseDirectory(c)}}/LeoPyRef.leo#Code-->Qt%20gui-->@file%20../plugins/nested_splitter.py-->class%20NestedSplitter%20(QSplitter)-->register_provider
>  
>
>
> I've posted examples here: 
> https://github.com/leo-editor/snippets/blob/master/examples/demo_widget.py 
> (the example is correct, the file:// link is missing some parameters 
> for the ns_do_context() method) 
>
> Cheers -Terry 
>
>

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to