By Brendan G. Lim

For builders who've discovered the based and hugely efficient Ruby language, it may be a true drag to modify again to a standard static programming device like Objective-C. MacRuby, a Ruby 1.9 implementation that sits without delay at the Mac OS X center, provides Rubyists the capability to code Cocoa apps with no sacrificing the language gains they have come to rely on.

MacRuby In Action is an educational for Ruby builders who are looking to code for OS X with out studying Objective-C. Readers will research the fine details of the MacRuby language, together with easy examples of constructing OS X purposes utilizing Cocoa parts. The middle of the booklet is an example-driven travel of the Cocoa framework from the Ruby point of view that specializes in getting issues done.

Show description

Read Online or Download MacRuby in Action PDF

Best Programming books

Embedded C

For those that are approximately to write down their first embedded application - or were suffering to profit approximately this crucial sector - this ebook will retailer weeks of attempt.

Cocoa Design Patterns

“Next time a few child indicates up at my door soliciting for a code evaluation, this is often the ebook that i'm going to throw at him. ”   –Aaron Hillegass, founding father of mammoth Nerd Ranch, Inc. , and writer of Cocoa Programming for Mac OS X   Unlocking the secrets and techniques of Cocoa and Its Object-Oriented Frameworks   Mac and iPhone builders are frequently crushed by way of the breadth and class of the Cocoa frameworks.

C++ Primer (5th Edition)

Bestselling Programming educational and Reference thoroughly Rewritten for the recent C++11 commonplace   absolutely up-to-date and recast for the newly published C++11 commonplace, this authoritative and finished creation to C++ might help you to profit the language quickly, and to take advantage of it in sleek, powerful methods.

Operating System Concepts

Maintain speed with the fast-developing international of working platforms Open-source working structures, digital machines, and clustered computing are one of the major fields of working platforms and networking which are quickly altering. With vast revisions and organizational adjustments, Silberschatz, Galvin, and Gagne’s working procedure options, 8th variation continues to be as present and suitable as ever, aiding you grasp the basic recommendations of working platforms whereas getting ready your self for today’s rising advancements.

Extra resources for MacRuby in Action

Show sample text content

Whereas you’re nonetheless within the inspector pane, set the identify of the window to MacRuby Browser. if you happen to like, be at liberty to alter the titles of the MainMenu component of the interface. via default, the menu goods contain NewApplication of their titles rather than MacRuby Browser. including THE URL deal with BAR AND WEB-PAGE VIEW to symbolize the handle bar, seize an NSTextField from the Library, and drag it to the pinnacle of the window. within the Attributes tab of the inspector pane, set the placeholder to go into URL to point that this box is for getting into an online tackle. additionally, lower than the motion drop-down record, pick out despatched on input simply. This reasons the NSTextField to ship you an motion whilst a consumer presses input. this can be a suitable resolution for you, because you won’t supply an particular button that navigates to the desired URL. you could upload a button for those who want; we lined how one can do that in bankruptcy three. From the library pane, locate the WebView item and drag that into the window, beneath the NSTextField. modify its dimension in order that it takes up the remainder of the interface window. be happy to enter the scale tab of the inspector pane to ensure that those parts alter their dimension thoroughly while the window is resized. TIP including A LOADING INDICATOR while the browser is really loading anything, it’s great to point that to clients within the interface. You’ll use the NSProgessIndicator, which monitors as a spinner. From the library pane, drag this into the window and position it to the correct of the NSTextField. within the inspector, make sure you uncheck show whilst Stopped since you wish the spinner to seem simply while there’s task. the completed browser window is proven in determine four. three. Now that you’ve manage a uncomplicated (and we suggest rather easy) interface for the browser, you can begin digging into the delegates for the WebView item. four. three. 2 developing the controller earlier than you create a controller dossier, you must upload the WebKit framework to the Xcode undertaking. with out the framework, the determine four. three the completed, albeit uncomplicated, MacRuby Browser UI 96 bankruptcy four determine four. four utilizing the delegate trend Clicking the + button to hyperlink a brand new library on your undertaking undertaking could throw many mistakes since it wouldn’t have entry to any of the WebKit periods, comparable to the WebView and the WebFrameLoadDelegate. including THE WEBKIT FRAMEWORK so as to add the WebKit framework, click on the undertaking identify within the venture navigator. this could convey you your undertaking settings. click on the construct stages tab, and extend hyperlink Binary With Libraries. subsequent, click on the + button as proven in determine four. four. From the conversation field that looks (see determine four. 5), input Webkit within the seek box. click on WebKit. framework, after which click on upload. determine four. five trying to find after which including WebKit. framework Using delegation in a customized MacRuby net browser ninety seven You’re now able to start at the application’s major controller. From Xcode, create a brand new category referred to as BrowserController. rb. SPECIFYING INITIALIZATION initiatives AND THE DELEGATE you begin via initializing the NSWindow, NSTextField, WebView, and NSProgressIndicator with the attr_accessor functionality: type BrowserController attr_accessor :window, :url_field, :web_view, :indicator finish then you definitely enforce the awakeFromNib approach to set the controller because the delegate for the WebFrameLoadDelegate protocol: def awakeFromNib @web_view.

Rated 4.73 of 5 – based on 42 votes