Page 1 of 1

Something's shortening my full-screen window

Posted: Sun Feb 07, 2016 8:46 am
by pderocco
I have an app compiled with 7.1.1 that presents a fixed 1280x800 window. On a Mac with a 1280x800 screen, I can get this to fit with

Code: Select all

set the rect of stack "main" to "0,20,1280,800"
This positions it so that its title bar is covered by the system menu bar, which is fine because the app name isn't important, and the "hide" button function can be performed with Option-H.

When I open it in the IDE, the IDE shortens and narrows the window by about 20 pixels, chopping the bottom and right off, so I have to enter the above command into the message box to restore it. I also included this command in my "startup" handler, to ensure it's properly sized and positioned when I run it as a standalone. However, if I build a standalone and then run it, I find that it is positioned correctly, and has the correct width, but the bottom 20 pixels are chopped off.

What's doing this, and how can I stop it?

Re: Something's shortening my full-screen window

Posted: Sun Feb 07, 2016 11:25 am
by Klaus
Hi Paul,

I think you have been bitten by "the windowboundingrect"!
Read this up in the dictionary.

This will ensure that there is room for e.g. the Menubar and/or dock on the Mac.
But it can be overwritten, by, well, just setting it to your desired values. :D

Add this to your standalone stack:

Code: Select all

on preopenstack
  set the windowboundingrect to "0,20,1280,800"
  set the rect of stack "main" to "0,20,1280,800"
  ## Optional to hide dock and Mac menubar:
  hide menubar
  ...
end preopenstack
Hint:
The "on startup" script will only work in a standalone, since the IDE will catch this during development.


Best

Klaus

Re: Something's shortening my full-screen window

Posted: Mon Feb 08, 2016 5:32 am
by pderocco
Turns out "on startup" didn't work, even in the standalone. But setting it in "preOpenStack" worked fine. Thanks.

Re: Something's shortening my full-screen window

Posted: Mon Feb 08, 2016 11:26 am
by Klaus
Hi Paul,

glad you got it working!
But I use the "startup" message very often in my standalones and never had any problem with it!?


Best

Klaus

Re: Something's shortening my full-screen window

Posted: Mon Feb 08, 2016 5:42 pm
by pderocco
"startup" gets called, but setting the rectangles in there, when the window size matches the screen size, didn't prevent it from shortening the bottom. "preOpenStack" worked, as you suggested, and I'm not about to try to figure out why the other didn't.