c, g and pΒΆ

Leo scripts execute in an environment containing three predefined objects: c, g and p.

g is Leo’s leoGlobals module. This module contains several dozen utility functions and classes.

c is the commander of the outline containing the script. Commanders defined all of Leo’s commands, as well as other data.

p is the position of the presently selected node. Positions represent positions in the traversal of Leo outlines.

This slide give a few examples of how to use c, g and p in Leo scripts. For full details about scripting in Leo, see the Scripting Chapter in Leo’s Users Guide.

Previous topic

Introduction

Next topic

Official ivars