Re: [wx-dev] Re: ANNOUNCE: wxCocoa
Re: [wx-dev] Re: ANNOUNCE: wxCocoa
- Subject: Re: [wx-dev] Re: ANNOUNCE: wxCocoa
- From: David Elliott <email@hidden>
- Date: Fri, 25 Jul 2003 17:26:57 -0400
On Friday, July 25, 2003, at 05:00 PM, The Amazing Llama wrote:
So is wxCocoa C++ or Objective-C?
If it's C++, it's not really Cocoa, is it?
If it's Objective-C, how do you call everything in the wx* libraries?
Objective-C classes that wrap C++ functions using Objective-C++? Or do
you just resort to making all your code Objective-C++ and then calling
the wx* stuff straight?
Other way around. The application would be written to the wxWindows
API (like any wxWindows application). wxCocoa is Objective-C++ code
that makes calls to the Objective-C Cocoa framework. Just like wxGTK
is C++ code that makes calls to the GTK C API and wxMSW to the Win32 C
API.
Essentially, each port of wxWindows is a new implementation of the same
API. That is how a program written to the wxWindows API can run well
on so many different platforms.
To handle Cocoa callbacks I use posing. That would allow you to (for
example) make a wxWindow out of an NSView that you've already
initialized if you desired. It also allows me to catch messages in
NSView even from classes derived from NSView, such as NSButton, without
having to implement the messages for each class. To find the wxWindows
object for a given Cocoa object, it uses a hash map. Check the code
out of CVS or use ViewCVS if you are interested.
Wouldn't either of these lose the benefits of Cocoa flexibility?
By nature of what it does, you probably won't be using .nib files in a
wxWindows application. However, there is an XML resource system
available that is similar in nature with a few different commercial
tools that edit the XML.
Just wondering, really. Cross-platform is good, but it's too often
taken as a 'Oh, and we can do that other platform, too' feature
checkbox, regardless of the starting platform (Windows, Linux, Mac,
etc).
wxWindows uses a different approach and more importantly a different
mindset compared with most other cross-platform toolkits.
-Dave
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.