Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MenuBarController
- def init
- if super
- # Create our status bar for the application
- puts "Initializing....."
- # menuZone = NSMenu.menuZone()
- # menu = NSMenu.allocWithZone(menuZone)
- menuItem = NSStatusBar.systemStatusBar.statusItemWithLength(NSVariableStatusItemLength)
- # And set it's details
- menuItem.setHighlightMode(true)
- menuItem.setImage(NSImage.imageNamed("MenuBarIcon.png"))
- menuItem.setTarget(self)
- menuItem.setAction('displayInformationWindow:')
- menuItem.setEnabled(true)
- puts "Initialized"
- # Also, create a window
- return self
- end
- end
- def displayInformationWindow(menuItem)
- puts "Clicked!"
- end
- end
Add Comment
Please, Sign In to add comment