Speed up resizing of app designer gui
9 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Alexandra McClernon Ownbey
on 10 Oct 2019
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 Comments
Alexandra McClernon Ownbey
on 12 Oct 2019
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?
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!