Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Calling OSX API similar to calling Win32 API?

Reply
Thread Tools

Calling OSX API similar to calling Win32 API?

 
 
Thomas Thomassen
Guest
Posts: n/a
 
      12-28-2010
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?

Example: get the handle for a window and change its frame style.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Skye Shaw!@#$
Guest
Posts: n/a
 
      12-28-2010
On Dec 28, 10:42*am, Thomas Thomassen <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
 
Thomas Thomassen
Guest
Posts: n/a
 
      12-29-2010
With the SketchUp Ruby API one can create your own custom windows -
called WebDialogs - which is simply a window with an embedded browser
control where you create your UI in HTML+JS+CSS.

The only control one has over these windows via the API is this:
http://code.google.com/apis/sketchup...webdialog.html

It does not allow you to change the window style. But I wanted to make
toolwindows and that I managed to do under Windows by using the Win32
API thanks to Ruby's Win32 module. (I send my own SetWindowLong message
after sniffing out the window's handle.)

So what I'm trying to do is modify windows which hasn't been created
directly by me.

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any similar Webcam broadcasting site similar to youtube Chaudhry Nijjhar Computer Support 0 02-19-2008 11:48 PM
win32 process information, using win32 extension Java and Swing Python 1 10-24-2005 09:13 PM
RE: win32 process information, using win32 extension Tim Golden Python 0 10-21-2005 02:18 PM
Calling the C API from Python and Python program from same C API -bidirectional Praveen, Tayal (IE10) Python 0 03-17-2005 06:33 AM
Hmmm... problems with CPAN (MakeMaker?) on Win32+MSYS or Win32+UnixUtils and others Alex Lyman Perl 0 03-07-2004 05:10 PM



Advertisments