Tweaking a window size
Tweaking a window size
- Subject: Tweaking a window size
- From: Graham Cox <email@hidden>
- Date: Tue, 30 Dec 2008 17:48:42 +1100
One of my windows has a delegate implementing the -
windowWillResize:toSize: method. This forces the window size to be
certain whole multiples of rows in a matrix of icons, the idea being
to prevent the user from sizing the window so that only a partial row
is visible, which is ugly. It works as I wish.
The user can also select whether they want small, medium or large
icons in this matrix, so the row height changes as a result. When this
happens I'd like to be able to tweak the window height as minimally as
necessary to conform to the "whole rows" requirement.
Since the delegate method already does all the needed calculation, I
figured I could just do something that would cause it to get triggered
just as if the user had dragged the resize widget. Unfortunately, -
setFrame:display: is explicitly excluded in the docs - it doesn't call
the delegate method - , so that's out. So I tried getting the saved
frame string then setting the frame using the string, but while that
should call the delegate, it appears not to if the size is the same as
the window's current size.
Any ideas how I can force the window to act as if it were being resized?
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden