From: "Skye Shaw!@#$" Date: 2010-12-29T05:25:21+09:00 Subject: Re: Calling OSX API similar to calling Win32 API? On Dec 28, 10:42 am, Thomas Thomassen wrote: > I'm writing plugins for Google SketchUp using its Ruby API. I want to > manipulate some windows from my script and under Windows I have this > working by using the Win32 API. > > But how can one do this under OSX? I've never used SketchUp, but I thought this was abstracted through their API (just curious)? Are these non-SketchUp windows of native applications? This sounds like it could be solved by the AbstractFactory pattern: http://en.wikipedia.org/wiki/Abstract_factory_pattern though I can't say if it's the right approach without more info. class OSXWindow def title #OSX native stuff end end # class Win32Window... class Window def initialize case PLATFORM #is there an arch-less variable for this? when /darwin/ OSXWindow.new when /win32/ Win32Window.new else raise "#{PLATFORM} is not supported" end end w = Window.new -Skye