Credit: Alun ap Rhisiart
You want to create a native Mac OS X program with a graphical user interface.
Use the Mac OS X Cocoa library along with RubyCocoa and the Interface Builder application. RubyCocoa creates real OS X applications and provides a GUI interface for building GUIs, as opposed to other libraries, which make you define the GUI with Ruby code. RubyCocoa is a free download, and the Cocoa development tools are on the Mac OS X installation DVD.
Interface Builder is very powerful: you can create simple applications without writing any code. In fact, it takes longer to explain what to do than to do it. Here's how to create a simple application with Interface Builder:
Start the Xcode application and create a new project from the File menu. Choose "Cocoa-Ruby Application" from the "New Project" list, hit the Next button, give your project a name and location on disk, and click Finish.
XCode will create a project that looks like Figure 21-7.
Figure 21-7. A new Cocoa-Ruby project
The Cocoa-Ruby project template comes with two files:
main.m (an Objective-C file)
rb_main.rb (a RubyCocoa
file). For a simple application, this is all the code you
Open the NIB Files group and doubleclick
MainMenu.nib to open Interface Builder. You get a new application window, into which you can drag and drop GUI widgets, ...