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 <InstructionView>
  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

Reply via email to