> Am 30.09.2015 um 16:11 schrieb Jens Alfke <j...@mooseyard.com>:
> 
> 
> 
>> On Sep 30, 2015, at 12:04 AM, Matthias Schmidt <b...@admilon.net> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to