-
-
Save alloy/22408 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MenuBarController | |
def initialize | |
# 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 | |
end | |
def displayInformationWindow(menuItem) | |
puts "Clicked!" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment