on click > window expand

Hi… Say I have a window that is 400 width by 150 heigh, and I want a
specific button the window to reveal a text window–therefore enlarging the
size of the window to say 500 height… Is the appropriate way to do this, to
build the window with the text field there, and then set the size t0 400x150,
and set max size to 400x500-- ?

If so-- I am having some problems… I cannot figure out how to

tell it to expand my window-- and if I leave the window resizable-- resizing
the window manually during the application never reveals the text field… It
just reveals a blank space on the window.

can I not use:
call method “setSize:” of window “testwindow” with parameter {400, 500}

? Or is the a better way I should do this?


You can use this:

set size of window "main" to {400, 500} -- {width, height}

But because the coordinates are drawn from the bottom left corner instead of the top left corner, the window appears to move, and so you can use this:

tell window "main"
	set window_bounds to bounds
	set bounds to {(item 1 of window_bounds), (item 4 of window_bounds) - 500, (item 1 of window_bounds), (item 4 of window_bounds)}
	-- set bounds to {(item 1 of window_bounds), (item 4 of window_bounds) - height, (item 1 of window_bounds) + width, (item 4 of window_bounds)}
end tell