Re: orderFront: 10.10 vs 10.9

2015-05-08 Thread Kyle Sluder
On Fri, May 8, 2015, at 09:40 AM, sqwarqDev wrote:
> Can't help with the "why", but try putting
> 
> [button lockFocus];
> 
> in that method. Even when there isn't an explicit unlockFocus call, I've
> had this error message a couple of times and adding an explicit lockFocus
> cured it.


Please don't blindly lock and unlock focus on views. You will have much
better results if you actually sit down and figure out where 
the bug is in your code.

--Kyle Sluder
___

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

Re: orderFront: 10.10 vs 10.9

2015-05-08 Thread Torsten Curdt
Seems like I found the culprit.

The drawing code was throwing an exception for a font that couldn't be
found.

cheers,
Torsten

On Fri, May 8, 2015 at 4:40 PM, sqwarqDev  wrote:

> >
> > On 10.9 I am seeing
> >
> >  "unlockFocus called too many times.
>
>
>
> Can't help with the "why", but try putting
>
> [button lockFocus];
>
> in that method. Even when there isn't an explicit unlockFocus call, I've
> had this error message a couple of times and adding an explicit lockFocus
> cured it.
>
>
>
>
> Best
>
> Phil
>
> DisplayDroid beta (a lightweight script editor and automation tool) is now
> available for free download. More info on sqwarq.com/displaydroid
> OSXClock - big, beautiful alarm clock and timer for your mac. More info on
> sqwarq.com/osxclock
>
> http://applehelpwriter.com
> http://sqwarq.com - apps for OS X & iOS
>
>
>
>
>
>
>
>
>
>
___

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

Re: orderFront: 10.10 vs 10.9

2015-05-08 Thread sqwarqDev
> 
> On 10.9 I am seeing
> 
>  "unlockFocus called too many times. 



Can't help with the "why", but try putting

[button lockFocus];

in that method. Even when there isn't an explicit unlockFocus call, I've had 
this error message a couple of times and adding an explicit lockFocus cured it.




Best

Phil

DisplayDroid beta (a lightweight script editor and automation tool) is now 
available for free download. More info on sqwarq.com/displaydroid
OSXClock - big, beautiful alarm clock and timer for your mac. More info on 
sqwarq.com/osxclock

http://applehelpwriter.com
http://sqwarq.com - apps for OS X & iOS










___

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

orderFront: 10.10 vs 10.9

2015-05-08 Thread Torsten Curdt
I am staring at this code and don't get why it works fine under 10.10 while
under 10.9 it does not.

NSScreen *screen = self.window.screen;
NSWindow *overlay = [[NSWindow alloc]
initWithContentRect:screen.frame

styleMask:NSBorderlessWindowMask

backing:NSBackingStoreBuffered
defer:NO];
self.instructionsWindow = overlay; // strong reference
overlay.opaque = NO;
overlay.ignoresMouseEvents = NO;
overlay.level = NSFloatingWindowLevel - 1;
overlay.backgroundColor = [NSColor colorWithCalibratedWhite:0.0
alpha:0.6];

InstructionsView *view = [[InstructionsView alloc]
initWithFrame:overlay.frame];

view.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
view.wantsLayer = YES;

overlay.contentView = view;
// [overlay.contentView addSubview:view];

InstructionsButton *button = [[InstructionsButton alloc]
initWithFrame:NSMakeRect(120, 45, 172, 44)];
[button setTitle:@"Done"];
[button setTarget:self];
[button setAction:@selector(actionInstructions:)];
[view addSubview:button];

NSLog(@"to front");
[overlay orderFront:nil];
// [overlay makeKeyAndOrderFront:nil];
NSLog(@"in front");

On 10.9 I am seeing

  "unlockFocus called too many times. Called on 
  Unlocking Focus on wrong view

I am getting no window and not even "in front" in the console.

The focus thing is strange, too. The code is actually generated by
PaintCode (for 10.9+) and there are no problem on 10.10.

Any pointers? I am running out of ideas.

cheers,
Torsten
___

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