This is so cool. LeoDocs.leo now contains this top-level script:
@button IntroSlides @key=Ctrl-9
It creates the slide introducing Leo's main window. It, and others like it,
will live permanently in LeoDocs.leo.
Each slide in the intro-slides-script tree will create a slide. At
present, there is only one node, called "Slide 1: Leo's main window". Here
it is:
outline_x, outline_y = 100, 100
body, tree, log = 'body', 'tree', 'log'
Title("This is Leo's main window")
table = (
(body, 'Body Pane', 100, 600),
(tree, 'Outline Pane', 200, 200),
(log, 'Log Pane', 400, 200),
(tree, '@file node -->', outline_x, outline_y + 20),
(tree, '@test node -->', outline_x, outline_y + 40),
)
for pane, h, x, y in table:
Callout(h, pane=pane, position=(x,y))
###
demo.next(
Right now the constants are wrong. I'm going to add a "show click" feature
to demo.py that will show where to put the callouts.
The setup and teardown methods are wonderfully useful. Here setup:
def setup(self, p=None):
c = self.c
self.end_on_exception = True # Good for debugging.
self.delta = 0
demo.set_text_delta(self.delta)
if hasattr(self, 'hoist_node'):
c.selectPosition(self.hoist_node)
for child in self.hoist_node.children():
if child.h. startswith('@@'):
child.h = child.h[1:]
c.hoist()
c.redraw()
And here is its companion, teardown:
def teardown(self):
c = self.c
self.delete_all_widgets()
if self.delta > 0:
self.set_text_delta(-self.delta)
if self.hoist_node:
for child in self.hoist_node.children():
if child.h. startswith('@'):
child.h = '@' + child.h
c.dehoist()
# c.selectPosition(self.hoist_node)
c.setChanged(False)
c.redraw()
These hoist and dehoist, and replace @@ nodes with @ nodes when showing the
demo.
This is a great example of executable docs. It's so much simpler than
slideshow.py.
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.