# Mac OS X 10.5 installation and cross-platform questions

**URL:** <https://www.ruby-forum.com/t/mac-os-x-10-5-installation-and-cross-platform-questions/187476>\
**Category:** wxRuby\
**Created:** [April 23, 2010, 7:01pm UTC](https://www.ruby-forum.com/t/mac-os-x-10-5-installation-and-cross-platform-questions/187476 "2010-04-23T19:01:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerscardua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ba0ec/32.png) [@rogerscardua](https://www.ruby-forum.com/u/rogerscardua)\
**Post date:** [April 23, 2010, 7:01pm UTC](https://www.ruby-forum.com/t/mac-os-x-10-5-installation-and-cross-platform-questions/187476/1 "2010-04-23T19:01:48Z")

</div>

I’m just beginning to learn wxRuby. I’m working on a WinXP sp3 machine,  
and I expect to test Linux using VirtualBox and Ubuntu and to test Mac  
OS X 10.5 on my wife’s Mac mini.

On her Mac, I got Ruby 1.9.1p376 installed following Dan Benjamin’s  
instructions at [Dan Benjamin](http://hivelogic.com/articles/ruby-rails-leopard)

(Yes, “which ruby” yields /usr/local/bin/ruby and “ruby -v” results in  
ruby 1.9.1p376 (2009-12-07 rev 26041) [i386\_darwin9.8.0] )

I then followed his instructions for installing RubyGems. And then  
installed the wxRuby gem.

My simple program creating 4 tall, colored buttons (I’ve put a zip of  
this at

> **[Google Sites: Sign-in](https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fsites.google.com%2Fsite%2Fsites%2Fsystem%2Ferrors%2FWebspaceNotFound%3Fpath%3D%2Fthecalculatorproject%2Fprojects%2Fadding-machines%2Fmachine-that-adds-1s-2s---code-listing&followup=https%3A%2F%2Fsites.google.com%2Fsite%2Fsites%2Fsystem%2Ferrors%2FWebspaceNotFound%3Fpath%3D%2Fthecalculatorproject%2Fprojects%2Fadding-machines%2Fmachine-that-adds-1s-2s---code-listing&ifkv=AeDOFXhlUnRYM3Tc9Guj1fXDxYIHH56biKvZ1v8xkZwE2NdMHNrvETaCcs2YzEgWwQcZPsG8K21LpA&passive=1209600&service=jotspot&flowName=GlifWebSignIn&flowEntry=ServiceLogin&dsh=S436918619%3A1690619419332754)**
>
> Access Google Sites with a personal Google account or Google Workspace account (for business use).

if you want to see it) worked exactly as expected on WinXP. I’m  
attaching a screen capture showing what it looks like on Windows.

On OS X, the program runs performs the few simple actions I built in,  
but it has almost none of the button colors and sizes spec’d. (Sorry I  
don’t have a capture of the result.)

Since this is my first trial, I haven’t really thought through the best  
way to represent a design that Windows, MacOS and Linux can all  
represent unambiguously. So if you look at my code and think, “Wow,  
that’s not the way to do this!” I won’t be surprised.

However, I’m not really sure I have got wxRuby installed properly on the  
Mac. Do I need to install wxWidgets independently? (I did install  
wxWidgets separately on WinXP.)

Since I have only sporadic access to this Mac, I haven’t yet tried  
running the example files and comparing the results with what I see on  
Windows (haven’t gotten to Ubuntu yet either).

Any thoughts on this process so far? Any obvious missteps I ought to  
correct? Any guidance on how to confirm I have got everything needed for  
things to run properly?

Thanks,

Roger S.

rsperberg at gmail

---

<div class="post-metadata">

**Author:** ![rogerscardua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ba0ec/32.png) [@rogerscardua](https://www.ruby-forum.com/u/rogerscardua)\
**Post date:** [April 23, 2010, 7:31pm UTC](https://www.ruby-forum.com/t/mac-os-x-10-5-installation-and-cross-platform-questions/187476/2 "2010-04-23T19:31:54Z")

</div>

Hi Roger

On 23/04/2010 18:01, Roger S. wrote:

> (Yes, “which ruby” yields /usr/local/bin/ruby and “ruby -v” results in  
> ruby 1.9.1p376 (2009-12-07 rev 26041) [i386\_darwin9.8.0] )

If you’ve done this, and ruby -rubygems \<program.rb\> runs a wxruby  
script, then you’ve almost certainly installed wxRuby and ruby  
correctly.

> On OS X, the program runs performs the few simple actions I built in,  
> but it has almost none of the button colors and sizes spec’d. (Sorry I  
> don’t have a capture of the result.)
> 
> Since this is my first trial, I haven’t really thought through the best  
> way to represent a design that Windows, MacOS and Linux can all  
> represent unambiguously.

I haven’t looked at your code, just at the screenshot. A few comments  
about the approach wxRuby takes, inheriting from wxWidgets might be  
helpful: in general, it allows the application designer to describe what  
each interactive element (eg button) should be doing, and where they  
should be - in relation to one another. wxRuby/Widgets takes this  
expression of intention and uses each OS’s native GUI toolkit to  
represent it visually on the screen. On Mac, push buttons are always  
that apple-y grey; frame close/min/max buttons are always on the top  
left and are red/yellow/green. That’s what the Apple UI guidelines say;  
that’s what Apple’s UI toolkit allows. It happens that Windows is more  
permissive/incoherent, depending on your view, so the button styles  
you’ve set actually apply.

It really depends what kind of interactive app you’re trying to create.  
wxRuby is a way of creating apps that will look “right”, function  
“right” and interact with the wider desktop in the “right” way on  
different platforms. They seek to build on users’ existing experience of  
how GUI appliccations work to provide ease of use. Though it is very  
flexible and customisable, it’s less well suited to apps which seek to  
create a very specific visual feel (down to exact pixels and button  
shapes). There are important times for such apps - but eg Flash is a  
more tailored environment for building them.

hth  
alex

---

<div class="post-metadata">

**Author:** ![rogerscardua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ba0ec/32.png) [@rogerscardua](https://www.ruby-forum.com/u/rogerscardua)\
**Post date:** [April 23, 2010, 8:18pm UTC](https://www.ruby-forum.com/t/mac-os-x-10-5-installation-and-cross-platform-questions/187476/3 "2010-04-23T20:18:40Z")

</div>

Alex F. wrote:

> Hi Roger
> 
> On 23/04/2010 18:01, Roger S. wrote:
> 
> > (Yes, “which ruby” yields /usr/local/bin/ruby and “ruby -v” results in  
> > ruby 1.9.1p376 (2009-12-07 rev 26041) [i386\_darwin9.8.0] )
> 
> If you’ve done this, and ruby -rubygems \<program.rb\> runs a wxruby  
> script, then you’ve almost certainly installed wxRuby and ruby  
> correctly.

Thanks for the confirmation!

> > I haven’t really thought through the best  
> > way to represent a design that Windows, MacOS and Linux can all  
> > represent unambiguously.

> It really depends what kind of interactive app you’re trying to create.  
> wxRuby is a way of creating apps that will look “right”, function  
> “right” and interact with the wider desktop in the “right” way on  
> different platforms. … Though it is very  
> flexible and customisable, it’s less well suited to apps which seek to  
> create a very specific visual feel (down to exact pixels and button  
> shapes). There are important times for such apps - but eg Flash is a  
> more tailored environment for building them.
> 
> hth  
> alex

Absolutely. My comments aren’t a complaint about wxWidgets.

In fact, what I am trying to do in this simple program is reduce a  
calculator to its bare essentials: two number keys (to simplify  
troubleshooting â€” first number added or second?), plus and equals; while  
still resembling the calculator that will be the final version.

In earlier versions I’ve made, I used bitmap images for the keys.  
However, using standard buttons seemed simpler as an overall process to  
explain (and, of course, coloring them and changing their shape to make  
them more calculator-like so the kids following my steps wouldn’t get  
discouraged from the first pass through the problem).

Obviously if OS X interprets the appearance instructions this  
differently for the standard button widget, I’d better rethink the  
“example reduced to its simplest parts.” For the complete calculator, I  
expect to use Wx::BitmapButton and want only for the general look to be  
the same, not identical results on different platforms.

Thanks for taking the time to respond to my post.

Roger

rsperberg at gmail

---

<div class="post-metadata">

**Author:** ![rogerscardua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ba0ec/32.png) [@rogerscardua](https://www.ruby-forum.com/u/rogerscardua)\
**Post date:** [April 24, 2010, 9:05pm UTC](https://www.ruby-forum.com/t/mac-os-x-10-5-installation-and-cross-platform-questions/187476/4 "2010-04-24T21:05:31Z")

</div>

Alex F. wrote:

> On 23/04/2010 19:18, Roger S. wrote:  
> The fact that all  
> Windows (widgets) have a colour= method is a bit deceptive, as it  
> implies that it’ll be honoured. As you’ve found OS X standard UI buttons  
> (and lots of others) don’t have any concept of a “colour”, or indeed of  
> a “size” (other than “Normal”, “Small” and “Mini” scale - which are  
> accessed differently)

I got onto the Mac mini here and ran the program again, this time  
remembering to make a screen capture. (To repeat: this is the same code  
that is rendered in the first screen capture, from Win XP.)

It is as you said.

The button background colors that I used actually do show up, filling  
the space between the pill-shaped button and the rectangular space it  
occupies.

Roger

rsperberg at gmail

---

<div class="post-metadata">

**Author:** ![rogerscardua](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ba0ec/32.png) [@rogerscardua](https://www.ruby-forum.com/u/rogerscardua)\
**Post date:** [April 23, 2010, 10:59pm UTC](https://www.ruby-forum.com/t/mac-os-x-10-5-installation-and-cross-platform-questions/187476/5 "2010-04-23T22:59:07Z")

</div>

On 23/04/2010 19:18, Roger S. wrote:

> Obviously if OS X interprets the appearance instructions this  
> differently for the standard button widget, I’d better rethink the  
> “example reduced to its simplest parts.” For the complete calculator, I  
> expect to use Wx::BitmapButton and want only for the general look to be  
> the same, not identical results on different platforms.

Yes, Wx::BitmapButton is the way to go, I think. The fact that all  
Windows (widgets) have a colour= method is a bit deceptive, as it  
implies that it’ll be honoured. As you’ve found OS X standard UI buttons  
(and lots of others) don’t have any concept of a “colour”, or indeed of  
a “size” (other than “Normal”, “Small” and “Mini” scale - which are  
accessed differently)

best  
alex
