Guest User

Untitled

a guest
Feb 20th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. class MenuBarController
  2. def init
  3. if super
  4. # Create our status bar for the application
  5. puts "Initializing....."
  6. # menuZone = NSMenu.menuZone()
  7. # menu = NSMenu.allocWithZone(menuZone)
  8.  
  9. menuItem = NSStatusBar.systemStatusBar.statusItemWithLength(NSVariableStatusItemLength)
  10.  
  11. # And set it's details
  12. menuItem.setHighlightMode(true)
  13. menuItem.setImage(NSImage.imageNamed("MenuBarIcon.png"))
  14. menuItem.setTarget(self)
  15. menuItem.setAction('displayInformationWindow:')
  16. menuItem.setEnabled(true)
  17.  
  18. puts "Initialized"
  19.  
  20. # Also, create a window
  21. return self
  22. end
  23. end
  24.  
  25. def displayInformationWindow(menuItem)
  26. puts "Clicked!"
  27. end
  28. end
Add Comment
Please, Sign In to add comment