app = NSApplication.sharedApplication app.delegate = AppDelegate.new window = NSWindow.alloc.initWithContentRect([200, 300, 300, 100], styleMask:NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask, backing:NSBackingStoreBuffered, defer:false) window.title = 'MacRuby: The Definitive Guide' window.level = 3 window.delegate = app.delegate button = NSButton.alloc.initWithFrame([80, 10, 120, 80]) button.bezelStyle = 4 button.title = 'Hello World!' button.target = app.delegate button.action = 'say_hello:'
What's with the .alloc thing? Hehe! :D The bit OR option style. Hash with symbols is what's the 'in thing' in Ruby.
I think the Ruby/Mac boys should join in the development, otherwise, it's still going to be Objective-C/Cocoa on this MacRuby thing.
No comments:
Post a Comment