Page 1 of 1

Problems with scaling - MacOS

Posted: Sun Aug 03, 2014 12:00 pm
by mvillion
HI

I wrote an app on my iMac with a screen resolution of 1024 x 768. Great - It all worked.
I sent it to a friend who had an Airbook 11 inch. That screen resolution is on 1366 x 768 so the Mac 'trimmed' the bottom of the Window (Because of the status bay and dock I think). Not so good.

To fix this
I tried full screen mode (all modes) and that sort of worked. It showed more of Window but not all of it. In my mind, it should fit.
In my mind should work but it does not.

So
I tried the scale factor down to 0.75 and it sort of worked. It fitted on the Airbook just great as it did scale the whole app down, but it still trimmed the Window (The same amount as if it did not fit), even though it actually fitted!!

Argh.
Both method trim the Window, even though there is enough space!!!
book
Is there a way I can scale the app down so I do not have to relayout it all out just to support the Airbook?

Any thoughts?

Re: Problems with scaling - MacOS

Posted: Sun Aug 03, 2014 2:02 pm
by dunbarx
Hi.

I develop for desktop, so I am probably out of my depth here. But what happens if you set the rect of the card window to the screenRect? Perhaps in a preOpenCard handler. Is that property supported on mobile as it is in the old-fashioned world?

Craig Newman

Re: Problems with scaling - MacOS

Posted: Sun Aug 03, 2014 2:36 pm
by Klaus
Hi mvillion,

1. welcome to the forum! :D

2. Check the "windowboundingrect" in the dictionary, I think this is the problem on the MB Air!
You can GET and also SET this property, so something like this might do the trick:

Code: Select all

on preopenstack
  set the windowboundingrect to the screenrect
  ...
end preopenstack
@ Craig,

we ARE talking about desktops here (iMac and MacBook Air) 8)


Best

Klaus

Re: Problems with scaling - MacOS

Posted: Sun Aug 03, 2014 2:39 pm
by mvillion
Hi

Yes. I wrote the app on an iMac with LOTS of screen space. 1024 x 768 was the app size.

I want to run it on a Macbook Air. (Not iPad Air). The macbook is screen res of 1366 x 768 but the app is always cropped, even in full screen mode (all modes of full screen mode).
It has me stumped. Even setting scalefactor to 0.75 makes a smaller window but it is cropped as if it was full size (Which makes no sense at all)

Performing a few tests I have worked it out that it is cropping the screen at 707 [or there a bouts] (of 768). I do not know if that is significant.

I have uploaded a test stack that demonstrates this problem.
The stack is designed to show the issue on an 11 inch Airbook. It will probably work on a 13 inch as the screen size will probably fit it.
I expect if the stack size is expanded to the same as the 13 air book and the buttons moved to the bottom again, the issue will show itself again.

Matt

Re: Problems with scaling - MacOS

Posted: Mon Aug 04, 2014 7:33 am
by Simon
Hi Matt,
You are not leaving room for stack decorations.
My screen is 1366 x 768 and the app doesn't really fit, lots of it is not hidden but off-screen.
Try;

Code: Select all

put the working screenRect
That will show you the screen resolution after all the (Mac) toolbar thingies. mine is 1024 x 738. Even that size is no good because I lose the titlebar.

Also to check the user add;

Code: Select all

on openStack
   set loc of this stack to the screenLoc
end openStack
That will ensure it's centered on the screen.
I wouldn't advise using scaleFactor as it does mess with some controls

I think I got it all,

Simon

Re: Problems with scaling - MacOS

Posted: Mon Aug 04, 2014 10:02 am
by mvillion
SOLVED

The app/stack was being resized when being run on the 11inch MacBook Air from 1024 x 768 to 1024 x 717, probably to accommodate the menu and dock.

SOLUTION 1 - Rescale app

Code: Select all

--Set the scale factor
     set the scalefactor of this stack to 0.75

--Resize the stack
     set the height of this stack to 768
     set the width of this stack to 1024
   
--Reposition the window
    set the location of this stack to 512, 450
SOLUTION 2 - Full Window

Code: Select all

--Resize the stack
     set the height of this stack to 768
     set the width of this stack to 1024

--Go full screen
   set the fullscreenmode of this stack to "showAll"
   set the fullscreen of this stack to true
    set the windowboundingrect to the screenrect
Thanks to all who provided the clues

Re: Problems with scaling - MacOS

Posted: Mon Aug 04, 2014 12:36 pm
by Klaus
Hi mvillion,,

to make the FULLSCRREN-FEELING complete you could also optionally add: hide menubar
That will hide the menu and dock on the Mac :D

To show again, yes, you guessed: show menubar


Best

Klaus