Re: NSDrawer offset problem (class bugs)
Re: NSDrawer offset problem (class bugs)
- Subject: Re: NSDrawer offset problem (class bugs)
- From: Shaun Wexler <email@hidden>
- Date: Thu, 16 Jan 2003 19:55:10 -0800
On Thursday, January 16, 2003, at 01:22 AM, Scott Anguish wrote:
>
I'm pretty sure that it does, within the constraints of the window
>
size issues. It is after all a child to the parent window.
>
>
When the drawer is closed, it is still attached to the window. If
>
you removed the drawer from the parent window, and attached it only
>
when the request to toggle open is made perhaps that would work. That
>
would allow you to make the window smaller when the drawer is closed
>
(by removing the draw when it toggles shut)
That is how I've implemented it. I call [drawer
setParentWindow:window] from within the drawer delegate method
(-drawerShouldOpen:onEdge:). Here is the problem: the window sets its
minSize according to the drawer contentView's minSize, which works as
expected in the lateral (pull-out) direction, but in the transverse
direction with leading and trailing offsets, the window adds the
offsets to the NSDrawerWindow frame size, which is bad behavior, since
the window can't be resized any smaller. The offsets should be
considered the equivalent of white-space, and flexible. The default
min 15 px trailing offset is the only thing that should be enforced by
the window.
I put my DrawerToggle NSButton subclass into a test app, which
illustrates the undefined NSWindow behavior. There are two drawers
created programmatically (since IB drawers are even buggier); the top
drawer uses its view's bounds as content minSize and maxSize, and the
bottom drawer uses a minSize of NSMakeSize(view.size.width, 1.0f) so
the window is able to be resized. Neither drawer exhibits the desired
behavior; my workaround is to use a custom NSWindow subclass, which
restricts its own size, so I can use the smaller drawer minSize.
The test project is attached. Thanks! Let me know what you think.
I'd sure like to hear from Apple on this issue, too...
--
Shaun Wexler
MacFOH
http://www.macfoh.com
[demime 0.98b removed an attachment of type application/octet-stream which had a name of DrawerTest.sitx]
_______________________________________________
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.