Skip to content

Instantly share code, notes, and snippets.

@takuma104
Created February 27, 2009 08:03
Show Gist options
  • Save takuma104/71347 to your computer and use it in GitHub Desktop.
Save takuma104/71347 to your computer and use it in GitHub Desktop.
require 'rubycocoa'
class MyAppDelegate < OSX::NSObject
def applicationDidFinishLaunching(application)
@window = OSX::UIWindow.alloc.initWithFrame(OSX::UIScreen.mainScreen.bounds)
@window.setBackgroundColor(OSX::UIColor.darkGrayColor)
@window.makeKeyAndVisible
@textView = OSX::UILabel.alloc.initWithFrame(OSX::UIScreen.mainScreen.bounds)
@textView.setText("hello RubyCocoa world")
@textView.setTextAlignment(OSX::UITextAlignmentCenter)
@textView.setFont(OSX::UIFont.boldSystemFontOfSize(24))
@textView.setTextColor(OSX::UIColor.whiteColor)
@textView.setBackgroundColor(OSX::UIColor.clearColor)
@window.addSubview(@textView)
end
end
OSX.UIApplicationMain(0, nil, nil, "MyAppDelegate")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment