Using BGHUDAppKit with MacRuby

This is a short tutorial on how to use BGHUDAppKit together with MacRuby. We assume that you have already installed Xcode 3.1 and MacRuby 0.4.

  1. Download (or rather checkout) the current version of BGHUDAppKit:
    svn checkout http://bghudappkit.googlecode.com/svn/trunk/ bghudappkit
  2. Open the file bghudappkit/BGHUDAppKit.xcodeproj in Xcode.
  3. In the source list on the left side, search for the target BGHUDAppKit, right-click it and choose Get Info (or Cmd-I).
  4. Select the tab Build and search for the option Architectures.
  5. Change the value of Architectures to 32/64-bit Universal (otherwise you will get a "no matching architecture in universal wrapper" error when launching your MacRuby application).
  6. Switch back to the project view and build the project (menu Build > Build or Cmd-B).
  7. After the build is complete, drag the file BGHUDAppKit.framework to the Frameworks group of your MacRuby project.
  8. Select your active target, right-click it and choose Add › New Build Phase › New Copy Files Build Phase.
  9. Double-click the new "Copy Files" build phase and select Frameworks from the Destination drop down.
  10. Drag the BGHUDAppKit.framework from the Frameworks group to the newly created build phase.
  11. Open the file rb_main.rb, search for
    framework 'Cocoa'
    and add the following line after it:
    framework 'BGHUDAppKit'
  12. Build your MacRuby project. It should run normally and raise no errors.

Finally you can access the new HUD controls in Interface Builder and add them to your interfaces, configure their properties, connect them with IBOutlets and IBActions, etc.

Keywords: mac, programming, ruby

Added by Thomas Dohmke 433 days ago


Comments

Add a comment

Twitter

Follow us on Twitter:

Keywords