Skip navigation.
 
mlNSDrawer delegate function mis-described?
FROM : Ben Kennedy
DATE : Mon Jan 27 22:46:35 2003

Hi all,

I am trying to implement code to keep an NSDrawer (attached to a document
window) at a fixed size when the user resizes the parent window.

According to the doc, I should be able to override the delegate method
drawerWillResizeContents:toSize:.  However, this method appears only to
be called when the drawer itself is being resized manually, and NOT when
the parent window is resized.  Quoth the doc,

>Invoked when the user resizes the drawer or parent. contentSize contains
>the size sender will be resized to. To resize to a different size, simply
>return the desired size from this method; to avoid resizing, return the
>current size. [...]


Is this a bug in the implementation, or in the doc?

More to the general point, can anyone suggest how to achieve what I want
to do?  It seems that the "content size" of the drawer is ignored in
favour of the leading and trailing edge sizes; for example, putting a
call to [drawer setContentSize:NSMakeSize(100,100)] in the parent
window's windowDidResize: delegate implementation causes the drawer to
resize to 100 wide, but its height still varies as per the trailing edge
value (the 100 width value is ignored).

So, instead I have tried adjusting the trailing edge value in
windowDidResize: instead.  Unfortunately, this only works for sizing the
window larger -- not smaller.  The window is only allowed to grow, and is
prevented from shrinking.  I suspect this is because I also have resize
increments set on the window (such that it is only allowed to size
vertically in intervals of ~150 pixels), and the system is noticing that
the drawer's current trailingOffset is too large to allow the window to
shrink by the increment.  It's a chicken/egg situation.  I have tried
moving the drawer adjustment to windowWillResize:toSize: instead, but
this results in ugly flicker as the drawer size flips around repeatedly.
Clearly 'didResize' is preferable to 'willResize' for such an adjustment.

Ideas?  Surely the problem of a fixed-size drawer has been tackled before...

-ben

--
Ben Kennedy, chief magician
zygoat creative technical services
613-228-3392 | 1-866-466-4628
http://www.zygoat.ca
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlNSDrawer delegate function mis-described? Ben Kennedy Jan 27, 22:46
mlRe: NSDrawer delegate function mis-described? Douglas Davidson Jan 27, 23:15
mlRe: NSDrawer delegate function mis-described? Ben Kennedy Jan 28, 00:19
mlRe: NSDrawer delegate function mis-described? Shaun Wexler Jan 28, 01:07
mlRe: NSDrawer delegate function mis-described? Shaun Wexler Jan 28, 01:18
mlRe: NSDrawer delegate function mis-described? Ben Kennedy Jan 28, 01:33
mlRe: NSDrawer delegate function mis-described? Ben Kennedy Jan 28, 01:35
mlRe: NSDrawer delegate function mis-described? Scott Anguish Jan 28, 05:42
mlRe: NSDrawer delegate function mis-described? Ben Kennedy Jan 28, 06:19
mlRe: NSDrawer delegate function mis-described? Shaun Wexler Jan 28, 07:40