Window Resize Indicator

Hi there,

I’ve got problems using the resize indicator for my main app window. I am using

set has resize indicator of window “main” to true/false

and the indicator shows or hides as expected. The trouble is that even when it doesn’t show I still can resize the window :frowning:

I obviously want the window to be non-resizable when it is not showing.

Anyone any ideas?

This is wierd. After checking around I found that there appears to be no way of toggling the resizable property of a window other than through IB. Huh??!! Maybe I’m wrong, but wouldn’t it make sense to be able to say “set resizable to false”?

Well, there is one property of the NSWindow class that can be jury-rigged to do the job. I used…

tell window "main"
	call method "setResizeIncrements:" of object it with parameter {2000, 2000}
	set has resize indicator to false
end tell

The resize increment property forces the window to resize in increments provided in the parameters, rather than incrementing in the default 1 pixel increment. If you use a huge number, the user will never be able to drag that far, and will never make it to the next potential increment. To set it back, just issue the call method again with parameters {1,1} and set your indicator back to true.

Hope this helps,
j

Thanks a lot jobu for this quick and dirty :wink: workaround.
It works like a charm.
You are right in asking for a “set resizable to false” functionality. Perhaps nobody ever noticed it’s missing. If somebody knows a more official solution: please let us know.

Best regards,

Supiter