wxruby-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Wxruby-dev] Mac OS X menubar!


From: John Platte
Subject: Re: [Wxruby-dev] Mac OS X menubar!
Date: Wed, 23 Jul 2003 13:22:09 -0500

So to get wxRuby scripts running on Mac OS X, I just have to wrap them in a properly constructed .app bundle directory and make the script self-executable (chmod a+x & appropriate shell line).

Now I suppose the wxRuby-on-OS X story turns to: how do we make these bundles automatically? It's all well and good for a compiled language where a Makefile can do work like this behind the scenes...

...maybe I just write a Ruby script that creates a bundle around a given Ruby script? The screwy part is that Apple wants you to use their API and not hard-coded paths for accessing files within a bundle, as noted in their documentation on the structure of bundles:

http://developer.apple.com/documentation/MacOSX/Conceptual/ SystemOverview/Bundles/chapter_5_section_3.html

This would mean that any additional scripts outside the single Ruby file have to be in Ruby's $: to be available, wouldn't it? Putting some debug spew into the bundled minimal.app script, I see that the bundled script's environment's pwd is "/". Maybe when wxRuby is require'd, it can chdir to the pwd for OS X and ensure that "." is in $:? I think that could let (some?) scripts run unmodified from other platforms with only a simple wrapping process.

OS X's Ruby is @ /usr/bin/ruby.

On Wednesday, Jul 23, 2003, at 12:01 America/Chicago, John Platte wrote:

Whoa!

On a whim I copied some of the stuff from the wxWindows .app bundles
into a minimal.app directory I created, and, and, this! (Screenshot
attached.)

The menu bar works, events get trapped, the script I used was the one
with the icon-handler problem and I could CLICK AND DISMISS the error
dialog, the About menu command works...!!!!

--
John Platte
Principal Consultant, NIKA Consulting
http://nikaconsulting.com/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]