Re: Drawer size reverts to window size automatically. Why?
Re: Drawer size reverts to window size automatically. Why?
- Subject: Re: Drawer size reverts to window size automatically. Why?
- From: Jeremy Dronfield <email@hidden>
- Date: Sun, 8 Sep 2002 13:45:10 +0100
On Sunday, September 8, 2002, at 08:33 am, David Rehring wrote:
On 9/7/02 11:28 PM, John McGruer at email@hidden wrote:
I have a window with a connected drawer - fairly standard except the
drawer
is wider than the parent window. No probs - looks a little funny
sliding
out, but works perfectly other than that. However, if a user tries to
resize
the drawer the drawer immediately drops down to the same (to my eye)
width
as the parent window - now only half the drawer can been seen and
cannot be
resized larger without quitting and restarting. Closing and opening the
drawer doesn9t help.
I believe this is a HIG issue that's been coded into the drawer
implementation. The drawer is never supposed to be wider than the
window
it's attached to. The implementation evidently enforces this in at
least
some circumstances.
Yes, it is an enforced HIG issue, but if your drawer absolutely has to
be wider than the window, you can use your own brute force by
implementing the following delegate method:
- (NSSize)drawerWillResizeContents:(NSDrawer *)sender
toSize:(NSSize)contentSize
{
NSRect view = [[sender contentView] frame];
NSSize stayPut = view.size;
return stayPut;
}
Of course, this means saying goodbye to drawer resizeability, but it
will prevent the behaviour you describe.
-Jeremy
========================================
email@hidden // email@hidden
The Alchemy Pages:
- fractious fiction at
http://freespace.virgin.net/jeremy.dronfield
========================================
_______________________________________________
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.