Friday, October 8, 2010

Yes, it's supposed to be Ruby, but this code don't look like Ruby to me. It's still Objective-C, minus the curly braces.

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.

Posted via email from markjeee.com

No comments: