> > Thanks to everybody. As I already noticed above, I solved the probvlem
> > by using JavaScript inpetrpreter from SpiderMonkey. Works fine both in
[quoted text clipped - 9 lines]
> Michael Ash
> Rogue Amoeba Software
>> > Thanks to everybody. As I already noticed above, I solved the probvlem
>> > by using JavaScript inpetrpreter from SpiderMonkey. Works fine both in
[quoted text clipped - 8 lines]
> Hm, I did not know that I can call Cocoa code from Carbon. It seems
> that it is possible http://developer.apple.com/documentation/Cocoa/Conceptual/CarbonCocoaDoc/index.html
They're just libraries. You're not calling Cocoa "from Carbon", you're
just calling it from your app. The question is whether you can mix the
two.
I'm not an expert on the subject but I believe that as long as you're on
10.2 or better*, the only real issue with mixing them is that you can't
insert controls or views from one framework into windows from another**.
In other words, everything inside a WindowRef must be Carbon, and
everything inside an NSWindow must be Cocoa. Aside from that, you can mix
and match at will. Just be aware that you need to initialize Cocoa before
you can start calling into it, and you'll need to provite autorelease
pools. The document you found sesems to cover all of this, so you should
be set.
* In case anyone is curious what was wrong on 10.1, the two frameworks
used totally different event dispatching methods which did not intermingle
at all. If you were in an application with a Cocoa event loop and you
registered some Carbon event handlers, they would not be called, and vice
versa. This was fixed on 10.2 and works fine now.
** Apple is able to do this, witness the limited Carbon support for WebKit
which ends up putting a WebView inside a Carbon window. However, their
techniques for this are Evil, and private, and you shouldn't even think
about attempting to duplicate this.

Signature
Michael Ash
Rogue Amoeba Software
Ben Artin - 19 Jun 2007 06:42 GMT
> * In case anyone is curious what was wrong on 10.1, the two frameworks
> used totally different event dispatching methods which did not intermingle
> at all. If you were in an application with a Cocoa event loop and you
> registered some Carbon event handlers, they would not be called, and vice
> versa. This was fixed on 10.2 and works fine now.
Having used this, I think that saying that it works fine now is a bit of a
stretch. More like, you can beat it into submission if you try hard enough and
your use case is not too complex.
Ben

Signature
If this message helped you, consider buying an item
from my wish list: <http://artins.org/ben/wishlist>
I changed my name: <http://periodic-kingdom.org/People/NameChange.php>
Andrei Korostelev - 19 Jun 2007 08:24 GMT
> >> > Thanks to everybody. As I already noticed above, I solved the probvlem
> >> > by using JavaScript inpetrpreter from SpiderMonkey. Works fine both in
[quoted text clipped - 37 lines]
> Michael Ash
> Rogue Amoeba Software
Thanks. We use Qt, so UI is not an issue.
--Andrei