MouseDown Observer detailed info

  • Hey Frederik,

    Is there anyway to find out what has been selected by mouse using any observer. I want to be able to show mark glyphs only on selected anchor simply because it's faster to render.

    Thank you as always :)

  • admin

    there is Glyph.selection.Changed notification

    small example
    also don't forget to remove the observer when your are done...

    class SelectionObsever(object):
        def __init__(self):
            self.g = CurrentGlyph()
            self.g.addObserver(self, "selectionChanged", "Glyph.selectionChanged")
        def selectionChanged(self, notification):
            glyph = notification.object
            for anchor in glyph.anchors:
                print anchor.selected