Sorry....not very well formatted question.
When I use the c.k.simulateCommand() method, it does an immediate redraw of
the outline. I would like to suppress the redraw until after I am done
making changes. I am looking at using position methods to do the same
thing so that I control the redraw, but haven't had time to suss it out
yet.
Also, I have been doing some stress testing on large, programatically
created outlines to see if there are scale limits in Leo. I have found
that Leo will crash if I use c.k.simulateCommand() on a large number of
nodes in one function.
I don't want to report this formally until I have a chance to dig into it
more, so this is just a heads up.
The specific code that I am working on is intended to build a journal with
weekly text files. This might be better served using a database, but I
have some specific requirements that make Leo and interesting potential
solution.....and it provides a great opportunity to learn the ins and outs
of the tool.
A code snip follows that illustrates what I am doing. This code does cause
Leo to hang, but not at consistent places in the operation, so I assuming
that it is a memory problem; perhaps stack space, or garbage collector
overflow, or some such.
monthNames = {"01-January","02-February","03-March","04-April","05-May",
"06-June","07-July","08-August","09-September","10-October","11-November","12-December"}
yr = 1960
for np in c.all_positions():
if (c.p.h[:5] == 'Year:'):
yr = int(c.p.h[-4:])
g.es(str(yr))
c.k.simulateCommand('goto-next-visible')
if (c.p.h[:5] == 'Year:'):
c.k.simulateCommand('move-outline-right')
if (c.p.h in monthNames):
c.k.simulateCommand('move-outline-right')
c.k.simulateCommand('move-outline-right')
elif (c.p.h[:1] == 'w'):
c.k.simulateCommand('move-outline-right')
c.k.simulateCommand('move-outline-right')
c.k.simulateCommand('move-outline-right')
On Wednesday, 7 December 2016 08:54:45 UTC-7, Edward K. Ream wrote:
>
> On Wed, Dec 7, 2016 at 9:40 AM, djc <[email protected] <javascript:>>
> wrote:
>
>>
>> Is there something like and echo_on and echo_off when
>> using c.k.simulateCommand()?
>>
>
> Not sure what you mean by "changes".
>
> 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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.