GUI Programming with MacRuby
Upcoming SlideShare
Loading in...5
×
 

GUI Programming with MacRuby

on

  • 3,717 views

 

Statistics

Views

Total Views
3,717
Views on SlideShare
3,637
Embed Views
80

Actions

Likes
1
Downloads
14
Comments
0

2 Embeds 80

http://lanyrd.com 78
http://uokada.tumblr.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    GUI Programming with MacRuby GUI Programming with MacRuby Presentation Transcript

    • GUI Programming withMacRuby
    • GUI Programming with MacRubyWho?What?When?Where?Why?How?
    • Who?
    • Erik Michaels-Ober?
    • sferikon Twitter, GitHub, Gmail, IRC, &c.
    • Code for America APPLY WITHIN
    • I’ve committed to...rails oauth2 rvmrails_admin faraday bundermerb_admin thor travis-citwitter multi_json dummy_datatwurl multi_xml git-pullssimple_oauth octokit mlb
    • HubCap
    • Who else?@lrz @benstiglitz@merbist @importantshock@rich_kilmer @naixn@alloy @watson1978@vincentisambart @Psychs@macruby macruby-devel
    • What?
    • What MacRuby1. A complete implementation of Ruby 1.9
    • Ruby apps MacRuby apps
    • DEMO
    • What MacRuby1. A complete implementation of Ruby 1.92. Allows you to script existing Mac apps3. Allows you to create new Mac apps
    • Let me tell you a secret...
    • AppleScript
    • Objective-C
    • Ruby Method Invocationobject.method parameter
    • Objective-C Method Invocation[object method:parameter];
    • Ruby Array Initialization and Assignmentarray = []
    • Objective-C Array Initialization and AssignmentNSMutableArray *array =[[NSMutableArray alloc] init];
    • RubyCocoa
    • MacRuby Hello Worldrequire hotcocoainclude HotCocoaapplication do |app|  win = window :size => [100,50]  b = button :title => Hello  b.on_action { puts World! }  win << bend
    • RubyCocoa Hello Worldrequire osx/cocoainclude OSXapp = NSApplication.sharedApplicationwin = NSWindow.alloc.initWithContentRect_styleMask_backing_defer(  [0, 0, 200, 60],  NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask,  NSBackingStoreBuffered, false)win.title = Hello Worldbutton = NSButton.alloc.initWithFrame(NSZeroRect)win.contentView.addSubview(button)button.bezelStyle = NSRoundedBezelStylebutton.title = Hello!button.sizeToFitbutton.frameOrigin = NSMakePoint((win.contentView.frameSize.width / 2.0) - (button.frameSize.width / 2.0),  (win.contentView.frameSize.height / 2.0) - (button.frameSize.height / 2.0))button_controller = Object.newdef button_controller.sayHello(sender)  puts "Hello World!"endbutton.target = button_controllerbutton.action = sayHello:win.displaywin.orderFrontRegardlessapp.run
    • Java
    • Objective-J
    • When?
    • When MacRuby NOW! Version 0.10Version 1.0 coming soon
    • When MacRubyMacRuby will be includedwith Mac OS X 10.7 Lion**currently as a private framework :(
    • Why?
    • Why MacRuby• You already know Ruby• Use existing Ruby gems• Ruby 1.9.2• No GIL• Multi-threaded generational GC• Fast!
    • Performance Benchmarks 8 Ruby 1.9 MacRuby 7 6 5 4 3 2 1app_answer app_tarai so_object vm1_ivar_set vm2_proc vm2_zsuper
    • Average Selling Price$12.00$10.00 $8.00 $6.00 $11.21 $4.00 $2.00 $4.19 $1.57 iPhone iPad Mac
    • How?
    • How MacRubymacruby.com
    • How MacRubyrvm get headrvm install macruby
    • How MacRubybrew install llvmport install llvm
    • How MacRubyFree with ADC account atdeveloper.apple.com/tools/xcodeor $4.99 on the Mac App Store
    • sferikon Twitter, GitHub, Gmail, IRC, &c.