• 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
Re: willPositionSheet never called ??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >willPositionSheet never called ?? (From: Jérome Foucher <email@hidden>)
 >Re: willPositionSheet never called ?? (From: Matt Ball <email@hidden>)

  • Prev by Date: Re: KVO and bindings question
  • Next by Date: Re: Problem with drawer
  • Previous by thread: Re: willPositionSheet never called ??
  • Next by thread: Apple, Are You Listening?
  • Index(es):
    • Date
    • Thread