• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Event loop in a secondary thread? Nibless Cocoa?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Event loop in a secondary thread? Nibless Cocoa?


  • Subject: Re: Event loop in a secondary thread? Nibless Cocoa?
  • From: Jens Alfke <email@hidden>
  • Date: Sat, 3 May 2008 20:04:35 -0700


On 3 May '08, at 4:35 PM, Bruce Sherwood wrote:

Visual, which is written in multithreaded C++, can be imported dynamically at any time in a Python program. Visual then has to start up an event loop to make a window and process events.

Oh boy, this is a flashback. You've got the exact same issues we had when we brought up Java on OS X back in 2000. The process starts out GUI-less (just an invocation of /usr/bin/python, in your case) and has to acquire a windowserver connection, event loop, menus, all that stuff.


This is pretty tricky stuff, or it was back then, and we had the advantage of being able to use or create private APIs. But more of that stuff might be public now. (Wasn't there some discussion on this list recently of upgrading a command-line process to a GUI?)

IIRC, you don't have to start the event loop on the process's main thread, but whatever thread you create the WindowServer connection on becomes the de facto GUI thread, on which the main event loop will run.

I don't see any problem with loading nibs. You just have to find them — presumably you'd put them next to wherever you put your code.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Event loop in a secondary thread? Nibless Cocoa?
      • From: Bruce Sherwood <email@hidden>
References: 
 >Event loop in a secondary thread? Nibless Cocoa? (From: Bruce Sherwood <email@hidden>)

  • Prev by Date: Re: Event loop in a secondary thread? Nibless Cocoa?
  • Next by Date: Re: Event loop in a secondary thread? Nibless Cocoa?
  • Previous by thread: Re: Event loop in a secondary thread? Nibless Cocoa?
  • Next by thread: Re: Event loop in a secondary thread? Nibless Cocoa?
  • Index(es):
    • Date
    • Thread