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!

 Akzeptierte Antwort

Daniel Shub
Daniel Shub am 26 Mär. 2012

0 Stimmen

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.

Weitere Antworten (1)

Jan
Jan am 26 Mär. 2012

0 Stimmen

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.

Kategorien

Mehr zu Environment and Settings finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by