Speed up resizing of app designer gui
조회 수: 4 (최근 30일)
이전 댓글 표시
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:
Unfortunately this does not help me to improve my gui.
Thanks in advance,
댓글 수: 0
답변 (1개)
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
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?
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!