GUIDE-Program interface cut-off

Hello,
I wrote a program that works perfectly fine on my computer and two laptops that I used for testing. All Windows 7 with different resolutions, (Matlab R2010b). But as soon as I give the program to a collegue to test it (Linux, R2009a) the program's GUI is cut off and the text size is bigger. For your information I am using size commands to change the UI and using "pixels" units with that, not "normalized". See screenshots:
My Screen:
My Collegues Screen:
Can anyone tell what is happening here? I would really appreciate a solution that does not change units to "normalized" as it would be quite a pile of work to change all that. (By changing one of the popup menus the whole GUI changes and the Boxes have to be realigned and the size of the program window changes.)
Thanks You!
~~CASE CLOSED~~
Turns out my collegue was using R2007 as i was using R2010b, which caused these differences. Seems like the old versions had different standard Fonts and Proportions.
Thanks!

 採用された回答

Daniel Shub
Daniel Shub 2011 年 9 月 21 日

1 投票

Are you relying on the default font and font size or are you setting it? I would think:
set(hfig, 'DefaultAxesFontName', fontName, 'DefaultTextFontName', fontName)
set(hfig, 'DefaultAxesFontSize', fontSize, 'DefaultTextFontSize', fontSize)
where hfig is an array of handles to the figure(s) in the gui and fontName and fontSize are the desired font name (string) and font size (double) would take care of teh font issues.
As for the resizing, does
get(0, 'MonitorPositions')
get(0, 'ScreenSize')
return reasonable values on your colleagues machine?

4 件のコメント

Henri
Henri 2011 年 9 月 21 日
I rely on the default font. I will try changing that.
I have no access to my colleague's machine right now, but what do you expect? He is using an 1280x720 resolution. Mine is 1920x1080, but I checked it on 1600x900 and 1280x720 as well and it worked.
I use this command for th resizing the window:
set(handles.figure1,'Position',[100 100 910 440]);
and
set(handles.figure1,'Position',[100 100 910 550]);
As I said before I am using 'Pixels' as units, not 'normalized'.
Daniel Shub
Daniel Shub 2011 年 9 月 21 日
Getting the screen size with dual monitors in Linux can be flakey, hence the question. It sounds like he is using a single monitor so it is probably not it. What happens on your machine if you change the default GUI font name and size to something large?
Henri
Henri 2011 年 9 月 29 日
To be honest I have difficulties changing the default font name and size.
In which function do I insert the two mentioned command lines? I put them into "function myprogramname_OpeningFcn(blabla)" in front of the line "guidata(hObject, handles);". But it doesn't work.
If I change the font size by using the GUIDE Property Inspector it changes th font size and makes the text disapper if the panel is too small, but the window size remains correct.
Daniel Shub
Daniel Shub 2011 年 9 月 29 日
I need a little more. Do you have the correct handles for hfig? I am not sure how guide works in this case, but maybe
set(0, 'DefaultAxesFontName', fontName, 'DefaultTextFontName', fontName)
set(0, 'DefaultAxesFontSize', fontSize, 'DefaultTextFontSize', fontSize)
right after you start MATLAB and before you do anything might help.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by