• 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: NSColorPanel and close box
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSColorPanel and close box


  • Subject: Re: NSColorPanel and close box
  • From: Matthias Schmidt <email@hidden>
  • Date: Wed, 30 Sep 2015 17:09:00 +0900

> Am 30.09.2015 um 16:11 schrieb Jens Alfke <email@hidden>:
>
>
>
>> On Sep 30, 2015, at 12:04 AM, Matthias Schmidt <email@hidden> wrote:
>>
>> while ([NSColorPanel sharedColorPanelExists]) {
>>       PA_Yield();
>>   }
>
> Yikes! That looks very suspicious. You shouldn't be running loops like that in a Cocoa app. AppKit is event driven, so you handle a single event and return.

there is PA_RunInMainProcess((PA_RunInMainProcessProcPtr)… which would run the panel as modal dialog, that would be one possible approach I guess.
So I need to redesign my code and open the panel like this:
NSInteger result = [ panel runModal ];

Another would be to split the tasks, like open panel and get panel values and close the thing, which would require to return a reference to the panel to 4D.

I have to think about that.


>
> It sounds like PA_Yield is running the run loop modally, which would explain why the color panel won't work. If that’s the way their plugin API works, it's got some problems.


it just keeps the current 4D process away from doing anything.

>
> (Also, why did you take this off-list? Now no one else can comment.)
(you replied directly to me and I just hit reply ;-)

Matthias


_______________________________________________

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


References: 
 >NSColorPanel and close box (From: Matthias Schmidt <email@hidden>)
 >Re: NSColorPanel and close box (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: NSColorPanel and close box
  • Next by Date: Re: questions on WebView for Mac apps
  • Previous by thread: Re: NSColorPanel and close box
  • Next by thread: NSTableView - Detecting when user has finished scrolling
  • Index(es):
    • Date
    • Thread