• 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
C Callback to update Cocoa UI elements - how?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C Callback to update Cocoa UI elements - how?


  • Subject: C Callback to update Cocoa UI elements - how?
  • From: ruffnex <email@hidden>
  • Date: Fri, 10 May 2002 01:54:25 +0800

Hi,

I have a C library function which is asynchronous (kicks off a thread) and accepts a C callback fn. The callback fn is invoked continuously, each time receiving some status info.

I would like to display this dynamic status info in my GUI e.g. NSTextField.
My problem is what code to put in the C callback function to be able to update the Cocoa UI controls.

Should I use an event mechanism to notify the main NSApplication thread e.
g. PostEvent: ? I believe that this should be MT-Safe. Does anybody have experience at this and could highlight any caveats?

What other approaches can you think of? What's the best approach in terms of ease of implementation? Are there complications due to the Obj-C runtime?

Your feedback is appreciated - thank you.

Rgds,

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.

  • Follow-Ups:
    • Re: C Callback to update Cocoa UI elements - how?
      • From: Raphael Sebbe <email@hidden>
  • Prev by Date: Re: A little guidance
  • Next by Date: Re: DO and Proxy Indirection
  • Previous by thread: Re: A little guidance
  • Next by thread: Re: C Callback to update Cocoa UI elements - how?
  • Index(es):
    • Date
    • Thread