Re: NSToolbar's setVisible and resizing parent window
Re: NSToolbar's setVisible and resizing parent window
- Subject: Re: NSToolbar's setVisible and resizing parent window
- From: Andy Lee <email@hidden>
- Date: Thu, 18 Apr 2002 22:59:43 -0400
At 1:44 PM -0400 4/18/02, Mike Pinkerton wrote:
I've noticed that calling setVisible on a NSToolbar will resize the
parent window as it shows and hides the toolbar. Is there any way
(private or public) to turn off this behavior? Some private method
to override?
I only know NSToolbar from the docs I've read, but I would try
creating a subclass of NSToolbar. I would override -setVisible: to
do the following:
- Remember the window's -isAutodisplay property.
- Tell the window to -setAutodisplay:NO.
- Remember the window's size.
- Call the inherited -setVisible:.
- Restore the window's remembered autodisplay property.
- Set the window's size to the remembered dimensions.
The NSToolbar would have to know what window it belongs to. I don't
know exactly how to do that, but you can always add an instance
variable if there is no cleverer way.
--Andy
_______________________________________________
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.