About the minimum width of GUI

2 visualizzazioni (ultimi 30 giorni)
Du Xiao
Du Xiao il 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!

Risposta accettata

Daniel Shub
Daniel Shub il 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.

Più risposte (1)

Jan
Jan il 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.

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by