• 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
Re: Newbie: window resize aloud with code?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie: window resize aloud with code?


  • Subject: Re: Newbie: window resize aloud with code?
  • From: Michael Jurewitz <email@hidden>
  • Date: Thu, 31 Aug 2006 11:03:26 -0700

Hi Marcus,

You should set up a delegate for your window that implements the NSWindow delegate method windowWillResize:toSize:. Returning the size passed in to this delegate method will result in the window not being allowed to resize. You should also take a look at the NSWindow method setShowsResizeIndicator:. You should be able to easily set up the state in your delegate or other controller to properly handle messages from your UI button.

For your reference:

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/doc/uid/20000013-BCICGJBG

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/doc/uid/20000013-BCIJDGGD

-Michael Jurewitz

*********************************************
Developer Technical Support Engineer

email@hidden
*********************************************

On Aug 31, 2006, at 10:11 AM, Keary Suska wrote:

on 8/30/06 12:55 PM, email@hidden purportedly said:

I have a window that is not resizable, but pressing a button should
make the user able to resize the window. How do I set resizable aloud
or not with code?

I don't think NSWindow has a method of allowing/disallowing window resize. I
don't think IB has one either. I believe the way it is done behind the
scenes is to set the minimum size and maximum size to the same value. This
would have the effect of disallowing, while setting min/max to other
arbitrary values would allow resize. I think this approach might hide the
resize control, but I don't recall.


You could also have a delegate implement -windowWillResize:toSize:, but it
might not be elegant.


Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: Newbie: window resize aloud with code? (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: Core Image filters for magnification
  • Next by Date: Re: Removing/Adding views in drawRect:
  • Previous by thread: Re: Newbie: window resize aloud with code?
  • Next by thread: Call method from a different file
  • Index(es):
    • Date
    • Thread