Contextual Menu in font view?

  • I saw this in the RF 1.7 release notes:

    Add contextual menu event in font overview with this notification: fontOverviewAdditionContextualMenuItems

    Could you give an example of how it’s used?


  • admin

    this should work in RoboFont 1.7

    good luck

    from import addObserver
    class test(object):
        def __init__(self):
            addObserver(self, "fontOverviewAdditionContextualMenuItems", "fontOverviewAdditionContextualMenuItems")
        def fontOverviewAdditionContextualMenuItems(self, notification):
            myMenuItems = [
                ("Hello", self.sayHello), 
                ("World", self.sayWorld),
                ("submenu", [("an item", self.sayAnItem)])
        def sayHello(self, sender):
            print "Hello"
        def sayWorld(self, sender):
            print "World"
        def sayAnItem(self, sender):
            print "an item"

  • Nice, thank you!

Log in to reply

Looks like your connection to RoboFont ● Forum was lost, please wait while we try to reconnect.