About the minimum width of GUI

I get a problem in making a small GUI, that is: A GUI is made and the width is set to 100 pixels, but it auto change it to 115 pixels. I am wondering why? If the width must be lager than a value (eg. 115 for my computer), can every computer screen is the same value? Thank you very much!

 채택된 답변

Daniel Shub
Daniel Shub 2012년 3월 26일

0 개 추천

I think this has more to do with your window manager (something hidden from you in Microsoft Windows). On my Linux box (KDE/KWin) I can get down to 18 pixels wide.

추가 답변 (1개)

Jan
Jan 2012년 3월 26일

0 개 추천

I confirm, that figures have a minimum width in Matlab 5.3 to 2011b under Windows:
figH = figure('Units', 'pixels', 'Position', [100,100,10,10])
get(FigH, 'Position')
>> ans =
100 100 132 10
But this differs from your 115 pixels. Try this to see the reason:
figure('menubar', 'none', 'toolbar', 'none', 'Units', 'pixels', 'Position', [100,100,10,10])
You see, that the header section of the created window contains the icon and the three buttons for minimizing, maximizing and closing. Therefore the minimal width depends on the width of these icons, which can be adjusted by the user.
You can override this limitation by using FEX: WindowAPI, but it is questionable if a window with partially concealed control buttons is user-friendly.

카테고리

도움말 센터File Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

질문:

2012년 3월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by