Re: Runloops, Cocoa and Carbon
Re: Runloops, Cocoa and Carbon
- Subject: Re: Runloops, Cocoa and Carbon
- From: email@hidden (Simon Fraser)
- Date: Mon, 8 Mar 2004 17:35:25 -0800 (PST)
- Organization: AOL
Reed Hedges wrote on 6/3/04, 7:30 am:
>
Hello,
>
Is [NSApp run] the only way to run the Cocoa event loop? Is there a
>
way to run it "once" in my own run loop?
>
>
The reason I ask is that I am trying to integrate two large
>
frameworks, wxWidgets and CrystalSpace. wxWidgets uses Carbon and
>
provides its own black-box "Application" class to run the run loop.
>
CrystalSpace uses Cocoa and also provides its own run loop (Some
>
setup, then [NSapp run]). I have read that Carbon and Cocoa can
>
co-exist in the same program, but I need to find a way to get these
>
runloops to both run. I have a test program set up to work within
>
wxWidgets framework, but not call the CrystalSpace runloop. As
>
expected, the CrystalSpace window never recieves any events, though it
>
displays and updates fine.
>
>
I am investigating several approaches to this. One is to run both
>
frameworks in seperate threads (I have a threadsafe middleware system
>
that will be doing all intercommunication between them anyway).
>
Another is to process Carbon events periodically within the CS loop.
>
Another is to work within the wxWidgets runloop, and process the Cocoa
>
event queue in that, and how to do that is my primary question here.
>
However, if anyone has any more ideas, I'd love to hear them.
>
>
TIA for any help, info or pointers!
You'll be in a world of pain trying to mix Carbon and Cocoa in the
same app, even if you keep them in separate windows.
wxWidgets (formerly known as wxWindows) now has a Cocoa port, so
you should probably look into that. It may still want to own the
mainloop, but you should find integration much simpler.
Simon
_______________________________________________
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.