Re: Terry, please explain how provided widgets get a parent

2018-08-27 Thread Edward K. Ream
On Sun, Aug 26, 2018 at 9:05 PM Terry Brown  wrote:


>
> Hmm, well the code worked for me when executed in two steps, as I
> thought I'd described, but maybe I didn't.
>
> First you execute the top part, i.e. import, class def, and
> c.free_layout.get_top_splitter().register_provider(TurtleProvider(c))
>
> then (easter egg menu) right click a divider, select Insert, which
> creates an action button, then click that to open the 'Graphics scene
> turtle' pane.
>
> Then run the second half of the code.
>

That's what I did, and it didn't work.

Happily, this is pretty much moot, because @pyplot actually does work in
the VR pane.

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


Re: Terry, please explain how provided widgets get a parent

2018-08-26 Thread Terry Brown
On Mon, 20 Aug 2018 15:39:12 -0500
"Edward K. Ream"  wrote:

> On Sat, Aug 11, 2018 at 2:17 PM Terry Brown 
> wrote:
> 
> > Without a parent I don't understand how the Turtle widget will ever
> > > become visible.
> >
> > Who told you parents are essential?  Probably your parents... :-)
> 
> Hehe.
> 
> But I do think specifying a parent, directly or indirectly, is
> essential. Without it, the window becomes a stand-alone window, or so
> I think.
> 
> I see the same behavior on Ubuntu or Windows.  The code you gave shows
> nothing in the allocated window area.  Modifications of the code show
> the staircase in an external window.

Hmm, well the code worked for me when executed in two steps, as I
thought I'd described, but maybe I didn't.

First you execute the top part, i.e. import, class def, and
c.free_layout.get_top_splitter().register_provider(TurtleProvider(c))

then (easter egg menu) right click a divider, select Insert, which
creates an action button, then click that to open the 'Graphics scene
turtle' pane.

Then run the second half of the code.

The above worked for me in vanilla (HOME=/tmp) Leo.

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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Terry, please explain how provided widgets get a parent

2018-08-20 Thread Edward K. Ream
On Sat, Aug 11, 2018 at 2:17 PM Terry Brown  wrote:

> Without a parent I don't understand how the Turtle widget will ever
> > become visible.
>
> Who told you parents are essential?  Probably your parents... :-)
>

Hehe.

But I do think specifying a parent, directly or indirectly, is essential.
Without it, the window becomes a stand-alone window, or so I think.

I see the same behavior on Ubuntu or Windows.  The code you gave shows
nothing in the allocated window area.  Modifications of the code show the
staircase in an external window.

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


Re: Terry, please explain how provided widgets get a parent

2018-08-11 Thread Terry Brown
On Sat, 11 Aug 2018 11:37:18 -0700 (PDT)
"Edward K. Ream"  wrote:

> I can get a Turtle window working outside the
> free_layout/nested_splitter framework. The graphics window is a
> separate window, as expected.
> 
> But I'm stumped at how the widget returned from ns_provide eventually
> gets a parent.  I don't see that happening in the NestedSplitter
> class.  For instance, in either ns.replace_widget or ns.
> replace_widget_at_index.  Well actually, there are calls to
> setParent(None), but why would that help?
> 
> Without a parent I don't understand how the Turtle widget will ever
> become visible.

Who told you parents are essential?  Probably your parents... :-)

I guess setting parents is good practice, but it's not essential.

Perhaps
https://github.com/leo-editor/leo-editor/blob/master/leo/plugins/nested_splitter.py#L865
does it implicitly.

Attached is what I get when I select / Ctrl-B run the first part of the
example, then add a Turtle pane, then select / Ctrl-B run the second
half of the example.

So it's visible and works.  But if your goal's drawing trees in a
QGraphicsScene I don't think you need to create a QGraphicsView of the
scene using free_layout in the first instance, that can always be done
later.

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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Terry, please explain how provided widgets get a parent

2018-08-11 Thread Edward K. Ream
I can get a Turtle window working outside the free_layout/nested_splitter 
framework. The graphics window is a separate window, as expected.

But I'm stumped at how the widget returned from ns_provide eventually gets 
a parent.  I don't see that happening in the NestedSplitter class.  For 
instance, in either ns.replace_widget or ns. replace_widget_at_index.  Well 
actually, there are calls to setParent(None), but why would that help?

Without a parent I don't understand how the Turtle widget will ever become 
visible.

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