FROM : Michael Jurewitz
DATE : Thu Aug 31 20:03:26 2006
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_removed>
*********************************************
On Aug 31, 2006, at 10:11 AM, Keary Suska wrote:
> on 8/30/06 12:55 PM, marcus.<email_removed> 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_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
DATE : Thu Aug 31 20:03:26 2006
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_removed>
*********************************************
On Aug 31, 2006, at 10:11 AM, Keary Suska wrote:
> on 8/30/06 12:55 PM, marcus.<email_removed> 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_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
| Related mails | Author | Date |
|---|---|---|
| Marcus Pedersén | Aug 30, 20:55 | |
| PGM | Aug 31, 00:12 | |
| Keary Suska | Aug 31, 19:11 | |
| Michael Jurewitz | Aug 31, 20:03 |






Cocoa mail archive

