Re: willPositionSheet never called ??
Re: willPositionSheet never called ??
- Subject: Re: willPositionSheet never called ??
- From: Jérome Foucher <email@hidden>
- Date: Wed, 2 Jun 2004 09:25:28 +0200
Le 1 juin 04, ` 21:47, Matt Ball a icrit :
The following code works for me in MyDocument.m:
- (NSRect)window:(NSWindow *)window willPositionSheet:(NSWindow *)sheet
usingRect:(NSRect)rect {
if([[sheet title] isEqualTo: @"Shape"])
{
NSRect fieldRect;
NSRect windowFrame = [mainWindow frame];
NSRect sheetFrame = [sheet frame];
int halfOfWidth = windowFrame.size.width/2;
int halfOfSheetWidth = sheetFrame.size.width/2;
fieldRect = NSMakeRect(halfOfWidth - halfOfSheetWidth,
windowFrame.size.height, sheetFrame.size.width, 0);
return fieldRect;
}
return rect;
}
FYI, that code moves the sheet up 20 pixels to fix a bug using Toolbars
in Sheets.
Did you maybe forget to return your rect at the end of the function?
Nope. I've put a NSLog at the very beginning of willPositionSheet, and
it never gets called.
Maybe it's related to my NSWindow subclass...... dunno
Thanks anyway,
Jerome
_______________________________________________
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.