gui coded with uifigure
이전 댓글 표시
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
Matlab Pro
2024년 6월 17일
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
2024년 6월 18일
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
2024년 6월 18일
Mario Malic
2024년 6월 19일
편집: Mario Malic
2024년 6월 19일
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
2024년 6월 20일
Mario Malic
2024년 6월 20일
Meanwhile, you can also try hiding the visibility of UIFigure, while you create components and see if anything changes.
Alain Barraud
2024년 6월 21일
Umar
2024년 6월 22일
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
2024년 6월 22일
편집: Walter Roberson
2024년 8월 10일
Alain Barraud
2024년 6월 22일
편집: Walter Roberson
2024년 8월 10일
dpb
2024년 6월 22일
Please format your code...use the funny-looking icon in the CODE section or select the code and CTRL-e
Alain Barraud
2024년 6월 22일
Mario Malic
2024년 6월 26일
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
2024년 6월 27일
Alain Barraud
2024년 6월 27일
Mario Malic
2024년 6월 28일
편집: Mario Malic
2024년 6월 28일
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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!