How to avoid truncating my GUI window

I wrote a standalone executable of a GUI on machine #1 and it worked fine, but on machine #2 the GUI window appeared much larger, even though the screen size and display resolution were the same. In addition the GUI window on #2 was truncated on the right so some content was missing. I originally chose Options > Resize behavior > Non-resizable because the resulting size units are characters which is supposedly better for cross-platform compatibility. I switched to Options > Resize behavior > Proportional. The entire GUI window was displayed on #2, but elements like radio buttons fell out of their bounding boxes and looked bad. [If you try this, save your original fig file with another name since you won't be able to undo the layout changes].
Next I restored the Non-resizable option so my GUI was in character units again, then changed the display scale of machine #2 so it was the same as machine #1 (in Windows 10, Control Panel > Display > Scale and Layout > Change the size of text, apps, and other items). Then the GUI showed up correctly on machine #2.
However I would like a solution that works regardless of the display setup of machine #2, since I won't always be able to control that. Does it exist?

4 件のコメント

Jan
Jan 2017 年 8 月 11 日
What are the unites of the GUI? Charcters, Centimeter, Pixel or normalized? Do the screens have a different DPI?
KAE
KAE 2017 年 8 月 16 日
GUI units are Characters. Screens have the same DPI (1920 x 1080). I wrote the GUI on a Dell Latitude 5470 and the other computer is a 5480.
[Apologies for the slow reply: I thought I got notification when comments are added but that's wrong].
Jan
Jan 2017 年 8 月 16 日
"1920 x 1080" is not the "DPI", but the resolution. You can set the DPI differently in the operating system (although this should depend on the physical dimension of the pixels on the screen only). I assume, this influences the 'character' units also.
KAE
KAE 2017 年 8 月 17 日
Drat, I had to ship out the other laptop and can no longer check this. The laptop I wrote it on has 166 DPI based on this lookup tool.

サインインしてコメントする。

 採用された回答

Faiz Gouri
Faiz Gouri 2017 年 8 月 17 日

0 投票

Since the size of a pixel can vary on different computer displays, using the default figure Units of pixels does not produce a UI that looks the same on all platforms. For this reason, GUIDE defaults the Units property for the figure to characters. Refer the following document for more info-
Also, sometimes the text setting size of the screen affect the display. Make sure it is set to 100%.

1 件のコメント

KAE
KAE 2017 年 8 月 17 日
編集済み: KAE 2017 年 8 月 17 日
You are correct that the text setting size was different between the two machines, and when I reset it, the GUI was no longer truncated. (My GUI is in character units). However I won't always be able to set the text setting size on laptops running my GUI executable. Is there some way to make sure the GUI won't be truncated, regardless of the other computer's text setting size?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

質問済み:

KAE
2017 年 8 月 11 日

編集済み:

KAE
2017 年 8 月 17 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by