Re: OMG: the LeoApp class needs no outline data!

2018-11-13 Thread pimgeek
Sounds very promising!

A related question to ask:

Can I turn Leo Editor App into a Leo Data Server by install the leoflexx 
plugin? (and then in theory I can access the data via Web Browser from 
every machine on the internet) :-O

Recently I try to bind Leo Data to a one-page WebApp via package eel 
, and I also noticed package flexx 
. Is that related to leoflexx.py? :-)

在 2018年11月13日星期二 UTC+8下午10:39:19,Edward K. Ream写道:
>
> None of the outline-related data structures mentioned in leoflexx.py 
> progress report 3 
>  are 
> needed!!
>
> Proof: The dicts returned by the app.redraw and app.send_children_to_tree 
> actions contain *all* the data the tree class is ever going to need.  If 
> not, I'll add more.
>
> The LeoApp class itself never needs these data because *LeoApp is on the 
> python side*.  app.make_redraw_dict has full access to real c and p 
> objects.
>
> End of code, end of performance worries.  It takes 0.000 seconds *not *to 
> compute something ;-) app.make_redraw_dict itself takes 0.006 seconds on my 
> machine.
>
> I am on the "put one in, get more than one out" part of the learning curve.
>
> The changeover to the new scheme will happen today or tomorrow.  You can 
> test the new code now by typing "redraw" (without the quotes) in the 
> minibuffer.
>
> 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: How to get viewrendered pane size?

2018-11-13 Thread pimgeek
Thanks for your quick reply!

The problem is, I want to hide / show vr pane but the default Alt-0 method 
always "breaks the layout"  after hiding and re-showing vr pane, it 
moved to an unexpected location.

I have figured out this solution by trail-and-error, is there any simpler 
ways to do it? :-)

# get lowercase leo filename
> this_filename = c.fileName().lower()
> # get vr obj
> vr = g.app.pluginsController.loadedModules['leo.plugins.viewrendered'].
> controllers[this_filename]
> curr_vr_width = vr.width()
> curr_vr_height = vr.height()
> # change pane size
> vr.change_size(...)
>
>
在 2018年11月13日星期二 UTC+8下午9:30:04,Terry Brown写道:
>
> On Mon, 12 Nov 2018 21:16:49 -0800 (PST) 
> pimgeek > wrote: 
>
> > I want to create a changePaneSize @command in myLeoSettings.leo, but 
> > don't know how to get and change pane size, what should I do? 
>
> Probably the easiest thing is to arrange the panes as you want them, 
> then right click the divider between panes (doesn't matter which one), 
> select 'Save Layout', and give the layout a name.  It should persist 
> after that. 
>
> 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.


OMG: the LeoApp class needs no outline data!

2018-11-13 Thread Edward K. Ream
None of the outline-related data structures mentioned in leoflexx.py 
progress report 3 
 are 
needed!!

Proof: The dicts returned by the app.redraw and app.send_children_to_tree 
actions contain *all* the data the tree class is ever going to need.  If 
not, I'll add more.

The LeoApp class itself never needs these data because *LeoApp is on the 
python side*.  app.make_redraw_dict has full access to real c and p objects.

End of code, end of performance worries.  It takes 0.000 seconds *not *to 
compute something ;-) app.make_redraw_dict itself takes 0.006 seconds on my 
machine.

I am on the "put one in, get more than one out" part of the learning curve.

The changeover to the new scheme will happen today or tomorrow.  You can 
test the new code now by typing "redraw" (without the quotes) in the 
minibuffer.

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: leoflexx.py: clarity and simplicity

2018-11-13 Thread Edward K. Ream
On Monday, November 12, 2018 at 9:54:11 PM UTC-6, Edward K. Ream wrote:

*Representing Archived Positions*
>
> *Aha*: ap's should just be dicts.  Leo's positions have _childIndex, v 
> and stack ivars, where stack entries are tuples of the form (v, 
> childIndex).  So the *ap dicts* will have the form:
>
> { 
>   'childIndex': p._childIndex,
>   'v': p.v.gnx,
>   'stack': [(v.gnx, childIndex) for (v, childIndex) in stack],
> }
>

 To this should be added:

'headline': p.h,

This is good for debugging, and perhaps for other uses.
...


> *Redrawing the screen quickly*
>
> When the redraw is requested, *the python side code will know which nodes 
> are expanded*.  gui.redraw will call app.redraw (also on the python 
> side), which will create a serializable *redraw list*.
>

Well, only a fool would use a lisp-like list. cons, cdr, caddr anyone? 

Recent revs add app.make_redraw_*dict* and its helpers, including 
app.dump_redraw_*dict*. These were even simpler than I had hoped.  They 
lead to a big Aha, which I'll trumpet in a separate thread.

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: How to get viewrendered pane size?

2018-11-13 Thread Terry Brown
On Mon, 12 Nov 2018 21:16:49 -0800 (PST)
pimgeek  wrote:

> I want to create a changePaneSize @command in myLeoSettings.leo, but
> don't know how to get and change pane size, what should I do?

Probably the easiest thing is to arrange the panes as you want them,
then right click the divider between panes (doesn't matter which one),
select 'Save Layout', and give the layout a name.  It should persist
after that.

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.


How to get viewrendered pane size?

2018-11-13 Thread pimgeek
I want to create a changePaneSize @command in myLeoSettings.leo, but don't 
know how to get and change pane size, what should I do?

-- 
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.