• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Tweaking a window size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Tweaking a window size
      • From: "Michael Ash" <email@hidden>
  • Prev by Date: Re: iTunes Scripting Bridge examples?
  • Next by Date: Re: NSColorWell shows no color
  • Previous by thread: Re: iTunes Scripting Bridge examples?
  • Next by thread: Re: Tweaking a window size
  • Index(es):
    • Date
    • Thread