About the minimum width of GUI

2 vues (au cours des 30 derniers jours)
Du Xiao
Du Xiao le 26 Mar 2012
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!

Réponse acceptée

Daniel Shub
Daniel Shub le 26 Mar 2012
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.

Plus de réponses (1)

Jan
Jan le 26 Mar 2012
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.

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by