gui coded with uifigure
Show older comments
Hi every body,
I have coded a moderatly complex gui first within a standard figure and a second version within a uifigure. As usually observed the second version is very very slow compared against the first one. This is not my problem. To obtain a correct gui I must execute ma code in debug mode step by step. Otherwise, the gui is very strange as if each graphic object was not finished before the next one begins to be buit. I have tried to add pause, drawnow, drownow limiterate, uifigure visible off until the last command... Nothing works.
Any idea to find a workaround?
Thank a lot
17 Comments
Matlab Pro
on 17 Jun 2024
Hi.
Even if there is a workarround - this is ridiculous!
I myself have very bad feelings about the new features of the new Graphical "upgrade" (especially appdesigner, which is super slow, cumbersome and worst than all: 100% binary file == no way to use any (Git) standard apps/tools for version control)
Please try to elaborate to Mathworks support or even better - send some angry letter.
:-(
Think would have to have a MWE that illustrates the behavior for anybody to be able to comment at all...
I gather the uifigure version was not built with AppDesigner but as standalone code? If so, have you built the same interface (or a subset of it at least) with AppDesigner to see if it also has the same behavior?
While I agree the overhead of the app is huge and painful, not being really a gui coder I've simply put up with the problems when a GUI was mandatory, but I've never seen such a behavior as you describe with the AppDesigner generated code. Then again, I've never built anything that would even approximate a "minimally complex" GUI, what more a "moderately" or "seriously" complex one...A few labels/textboxxes and check boxes to allow user to select input files and some minimal control over what the app does is about it...other than that, I use MATLAB almost exclusively as development/exploratory data analysis tool and interactively because I rarely do the same thing more than once...
Rik
on 18 Jun 2024
I don't recognize the main symptom you are describing, so I agree that reproduction code would be a good idea.
I only write GUIs from code, because I want to support a wide range of releases (back to v6.5, which celebrates its 23rd birthday today). I know that at some point the plan is to transition normal object to the ui type, since that makes them easier to make cross-platform. The community advisory board has stressed to Mathworks that it is important the performance gap is minimized before that happens.
Alain Barraud
on 18 Jun 2024
Mario Malic
on 19 Jun 2024
Edited: Mario Malic
on 19 Jun 2024
Sure, people will take a look at it if you post the code.
It may be a Windows related issue. This is just a wild guess, go to MATLAB.exe, Properties, Compatibility, Change high DPI settings:

I don't have experience with building complex apps only from the code, however, one thing that may be useful is to maybe use gridlayout.
Alain Barraud
on 20 Jun 2024
Mario Malic
on 20 Jun 2024
Meanwhile, you can also try hiding the visibility of UIFigure, while you create components and see if anything changes.
Alain Barraud
on 21 Jun 2024
Umar
on 22 Jun 2024
Hi Alain,
I would suggest that you ensure the uifigure is visible at the end of the GUI construction in Matlab, you need to explicitly set the visibility property of the uifigure object. You can do this by using the Visible property and setting it to 'on' at the appropriate stage in your code. By setting the Visible property to 'on' when needed, you can ensure that the uifigure` becomes visible at the end of the GUI construction process.
Alain Barraud
on 22 Jun 2024
Edited: Walter Roberson
on 10 Aug 2024
Alain Barraud
on 22 Jun 2024
Edited: Walter Roberson
on 10 Aug 2024
dpb
on 22 Jun 2024
Please format your code...use the funny-looking icon in the CODE section or select the code and CTRL-e
Alain Barraud
on 22 Jun 2024
Mario Malic
on 26 Jun 2024
Apologies for the delay, I would have checked this but we can't reproduce this. I don't really see any issues in this code or something that would take super long.
Alain Barraud
on 27 Jun 2024
Alain Barraud
on 27 Jun 2024
Mario Malic
on 28 Jun 2024
Edited: Mario Malic
on 28 Jun 2024
Alright, I have encountered this issue. I think what helps is, if you resize the figure, and it will update the layout.
I don't know the reason why this would happen.
Accepted Answer
More Answers (0)
Categories
Find more on Environment and Settings 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!