GUIDE-Program interface cut-off

9 次查看(过去 30 天)
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
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-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 个)

类别

Help CenterFile Exchange 中查找有关 Creating, 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