Re[2]: Can a sheet appear at an arbitrary window position?
Re[2]: Can a sheet appear at an arbitrary window position?
- Subject: Re[2]: Can a sheet appear at an arbitrary window position?
- From: Lance Drake <email@hidden>
- Date: Sat, 8 May 2004 13:40:19 -0600
There's the window delegate method
-window:willPositionSheet:usingRect: (10.3 only) From the NSWindow
docs:
- (NSRect)window:(NSWindow *)window willPositionSheet:(NSWindow
*)sheet usingRect:(NSRect)rect
"Sent to the delegate just before the animation of a sheet, giving it
the opportunity to return a custom location for the attachment of the
sheet (sheet) to the window (window)"
There's more information in:
file:///Developer/Documentation/Cocoa/Conceptual/Sheets/index.html
Look at "Positioning Sheets".
Regards,
-Jeremy
Hi Jeremy,
Oh my gosh! - That's EXACTLY what I was looking for. That call didn't
pop out at me from the NSWindow.h header. Maybe I had the search
dialog set on 'whole words' or something...?
It's unfortunate they named it 'willPositionSheet' - which sounds more
like an interrogative than a command. Maybe I looked at it and got the
wrong idea about its intended purpose? Who knows - but there it is...
Anyway - it's THE perfect call except, sadly, it's a 'Panther+'
feature. DARN! The requirements for my project are to also include
Jaguar-level support - which seems silly to me because I think everyone
should always be running the latest-n-greatest, but then many people
have yet to move up to the really cool-brave-new-world of Panther
(never mind the rather large contingent of OS9 holdouts).
The other idea I heard about (thanks! to Greg Hulands) was to use a
'transparent window' located at the coordinates desired - and to have
the sheet load from that object. The problem is that windows can be
independently dragged - but not if you use a borderless style.
Regardless, if - while the sheet was out - the main window was moved,
the borderless window would stay located in the main Finder area where
it was originally positioned. I suppose you could then send 'move'
messages to the transparent-borderless window - which is what it
appears Preference utilities like 'Default Folder' do to keep their
gizmos attached to the Finder's StandardGetfile dialog, etc. However,
for me to fully implement that idea seems like buying a bus-ticket to
klooge-county.
All told, the Panther+ solution IS what I was looking for. Thanks so
much for taking the time to respond to my question. For the record, I
did 'RTFM' - only not very well. Your clarifying confirmation about
'willPositionSheet' has brought me to the conclusion that I need to
come up with another approach to getting this chore done. For your
'wind at my back' assist - I am grateful.
Best Regards,
Lance Drake
_______________________________________________
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.