On Thu, Nov 11, 2010 at 12:35 PM, taa, Leo Newbie <[email protected]> wrote:

> Unmark-all appears to remove all marks in ALL outlines and not just
> the currently selected one.

You are confused about what "the outline" means.

The docstring for the unmark-all command is:

'''Unmark all nodes in the entire outline.'''

I think this is as clear as it can possibly be.

How can I unmark only the select outline
> (node) and all its children?

The proper terminology would be, umark the selected *node* and all its children.

I don't think there is a command that does exactly this, but the
following script will do the job:

for p in c.p.subtree():
   p.clearMarked()
c.redraw()

I put it in a node called @button unmark-tree.

To make this undoable, use the following (tested) code:

u = c.undoer ; undoType = 'unmark-tree'
changed = False
u.beforeChangeGroup(c.p,undoType)
for p in c.p.subtree():
    if p.isMarked():
        bunch = u.beforeMark(p,undoType)
        p.clearMarked()
        u.afterMark(p,undoType,bunch)
        changed = True
if changed:
    u.afterChangeGroup(c.p,undoType)
    c.redraw()

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to