• 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
NSBezierPath drawing USED to work...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSBezierPath drawing USED to work...


  • Subject: NSBezierPath drawing USED to work...
  • From: Paul Cezanne <email@hidden>
  • Date: Mon, 24 Mar 2003 14:20:53 -0500

I'm baffled by this one. I have some code I wrote MONTHS ago, worked fine then. For my application, I need to make a full screen window and draw into it, in a window that is UNDER my "real" window. In my code, (see below), I make an NSWindow programatically and set the view to be a custom view, CBackgroundTargetView.

Now CBackgroundTargetView has it's own drawRect method and that method is being called. The problem is is that nothing is being drawn!

I use this code. (Note, I know CGShieldingWindowLevel is Jaguar only, I've simplified my code for this posting.)

I'd appreciate any insights. Thanks!


// from CMainController
- (IBAction) fullScreenOn: (id)sender
{
int windowLevel;

windowLevel = CGShieldingWindowLevel();

if(fullScreenWindow == nil){

fullScreenWindow = [[NSWindow alloc]
initWithContentRect: [[NSScreen mainScreen] frame]
styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered
defer:NO screen:[NSScreen mainScreen]
];

[fullScreenWindow setLevel:windowLevel];
[fullScreenWindow setIgnoresMouseEvents:true]; //-- Jaguar only...

[fullScreenWindow setBackgroundColor:[NSColor blackColor]];
[fullScreenWindow setReleasedWhenClosed: NO];

fullScreenImageView = [[CBackgroundTargetView alloc] init];
[fullScreenImageView setMainController:self]; // can't do this at nib time!
[fullScreenImageView setMainWindow:myBlueEyeWindow]; // can't do this at nib time!
[fullScreenImageView SetType:m_type];
[fullScreenWindow setContentView: fullScreenImageView];
}

if(isJaguar){
[fullScreenWindow orderFront:nil];
}else{
[fullScreenWindow orderWindow:NSWindowBelow relativeTo:[myBlueEyeWindow windowNumber]];
[myBlueEyeWindow orderWindow:NSWindowAbove relativeTo:[fullScreenWindow windowNumber]];
}

// now bring the calibration window frontmost
if(isJaguar){
[myBlueEyeWindow setLevel:CGShieldingWindowLevel()];
}
[myBlueEyeWindow makeKeyAndOrderFront:nil];

}


// drawRect from CBackgroundTargetView

- (void) drawRect:(NSRect) rect
{
NSRect r = [myMainController getScreenRect];
//[myMainController grabWindowNumber];
NSBezierPath *bp = [NSBezierPath bezierPathWithRect:r];
// erase it first
NSColor *color = [NSColor redColor]; // just to see SOMETHING happen
[color set];
// lots of other NSBezierPath drawing deleted
[bp fill];

}

--
--
Paul Cezanne
Senior Member of Technical Staff
Sequel Imaging
_______________________________________________
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.

  • Prev by Date: Including headers from a framework?
  • Next by Date: Adding AppleScript support to a Cocoa aplication
  • Previous by thread: RE: Including headers from a framework?
  • Next by thread: Adding AppleScript support to a Cocoa aplication
  • Index(es):
    • Date
    • Thread