(self, aNotification)
Create a toolbar and menu for the mac application that can be used
        to close shut down the application.
Create a toolbar and menu for the mac application that can be used
        to close shut down the application.
Create a toolbar and menu for the mac application that can be used to close shut down the application .
def applicationDidFinishLaunching_(self, aNotification):
        """
        Create a toolbar and menu for the mac application that can be used
        to close shut down the application.
        """
        self.statusItem = NSStatusBar\
            .systemStatusBar()\
            .statusItemWithLength_(NSVariableStatusItemLength)

        self.statusItem.setTitle_(u"M")
        self.statusItem.setHighlightMode_(TRUE)
        self.statusItem.setEnabled_(TRUE)

        self.quit = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
            "Quit", "terminate:", "")

        # ugly but... it provides the information.
        self.port = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
            "Listening on localhost:{0}".format(_PORT), "", "")

        self.menubarMenu = NSMenu.alloc().init()
        self.menubarMenu.addItem_(self.port)
        self.menubarMenu.addItem_(self.quit)

        # add the menu to status bar item
        self.statusItem.setMenu_(self.menubarMenu)
        self.statusItem.setToolTip_(u"mimic - rackspace mock api")

        AppHelper.callLater(1, startMimic)
def applicationDidFinishLaunching_ ( self , aNotification ) : self . statusItem = NSStatusBar . systemStatusBar ( ) . statusItemWithLength_ ( NSVariableStatusItemLength ) self . statusItem . setTitle_ ( u"M" ) self . statusItem . setHighlightMode_ ( TRUE ) self . statusItem . setEnabled_ ( TRUE ) self . quit = NSMenuItem . alloc ( ) . initWithTitle_action_keyEquivalent_ ( "Quit" , "terminate:" , "" ) # ugly but... it provides the information. self . port = NSMenuItem . alloc ( ) . initWithTitle_action_keyEquivalent_ ( "Listening on localhost:{0}" . format ( _PORT ) , "" , "" ) self . menubarMenu = NSMenu . alloc ( ) . init ( ) self . menubarMenu . addItem_ ( self . port ) self . menubarMenu . addItem_ ( self . quit ) # add the menu to status bar item self . statusItem . setMenu_ ( self . menubarMenu ) self . statusItem . setToolTip_ ( u"mimic - rackspace mock api" ) AppHelper . callLater ( 1 , startMimic )