Speed up resizing of app designer gui

조회 수: 4 (최근 30일)
Philipp Soentgerath
Philipp Soentgerath 2019년 10월 10일
댓글: Philipp Soentgerath 2019년 10월 14일
I have a fairly large gui with daisy chained tab groups panels and many individual ui elements. Meanwhile, the time for resizing of the window has become inappropriately big. (>1min).
Inside the tab groups panels are distributed by a grid layout. The auto resize children option is on.
Are there any rules/suggestions how to avoid/debug long resize events?
Using the profile viewer during a resizing leads to this output:
2019-10-10 07_18_40-Profiler.png
Unfortunately this does not help me to improve my gui.
Thanks in advance,

답변 (1개)

Alexandra McClernon Ownbey
Alexandra McClernon Ownbey 2019년 10월 10일
For a gui, I always manually define the size a location of all my objects. I find it best to use normalized units. If I have several objects, say 3, that I want to distribute evenly within my figure, I just use ratios in the form of fractions for the height.
figure('units','normalized',...
'position',[0.3 0.3 0.3 0.3])
h.but1 = uicontrol('sytle','pushbutton',...
'units','normalized',...
'position',[0 2/3 0.3 1/3],...
'string','button1')
h.but2 = uicontrol('sytle','pushbutton',...
'units','normalized',...
'position',[0 1/3 0.3 1/3],...
'string','button2')
h.but3 = uicontrol('sytle','pushbutton',...
'units','normalized',...
'position',[0 0 0.3 1/3],...
'string','button1')
The position and sizing can always be changed later. I find it sometimes useful to reference the previous size, expecially if you are using uitable. (uitable has a property called 'extend' that lists the extension of the table so you don't have any remaining white space).
h.but1.Position = h.but1.Position + [0 0 0.2 -0.1];
Is this what you were refering to? Or is it something else in your gui that is slowing down resizing the whole figure?
  댓글 수: 3
Alexandra McClernon Ownbey
Alexandra McClernon Ownbey 2019년 10월 12일
Do you have any data stored/plotted in your gui? The GUI may be slow due to the amount of data held; this also goes for a large number of objects in the GUI. Have you also tried running it on a different machine?
Philipp Soentgerath
Philipp Soentgerath 2019년 10월 14일
During the run time serveral axes and one hugh table are created dynamically, but resizing is equally slow before and after this.
I think the sheer number of elements could be the problem. There are serveral hunderds of them, distributed over 8 tabs. So only ~100 are present in the figure. (Don't know if that helps). All other gui interactions still work fine without a bothering delay.
The problems occurs on every machine (3 pc with very similar configuration) and they are professional workstations.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by