MouseDown Observer detailed info

RoboFont Forums Help / General MouseDown Observer detailed info

This topic contains 1 reply, has 2 voices, and was last updated by  frederik 4 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6225

    bahman
    Participant

    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 :)
    Bahman

    #6233

    frederik
    Keymaster

    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
            
    SelectionObsever()
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.