Rearranging appdesigner generated code sections?

조회 수: 15 (최근 30일)
Roy Porter Jr
Roy Porter Jr 2020년 8월 5일
댓글: Nuwan Liyanage 2022년 6월 23일
Is there a way to reorder generated code in app designer?. An example would be that I have user functions to select options called step1 through step4 then function for pushbutton to execute. Somehow the functions show up out of order and 1 shows up after pushbutton in code view. Really messy. I want to group functions together and in order of usage.
  댓글 수: 2
Adam Danz
Adam Danz 2020년 8월 5일
편집: Adam Danz 2020년 9월 20일
As far as I'm aware, callback functions cannot be reordered from within app designer. This is a known issue.
Private and public functions within the mlapp file can be reordered, though.
Depending on what's going on within the callback functions, one workaround might be to use one callback function for all "steps" and to define a switch/case within the callback function to handle different actions for each button.
Update: Starting in Matlab r2020b, change the stack order of UI components in App Designer using the reorder tool (see release notes).
Nuwan Liyanage
Nuwan Liyanage 2022년 6월 23일
Hi Roy,
I found this only now, but yes, the MATLAB 2020b has the functionality to reorder in the code browser window in the design view.

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

채택된 답변

CallumP
CallumP 2020년 8월 14일
I've written an app: https://uk.mathworks.com/matlabcentral/fileexchange/71838-hierarchyviewer which allows you to reorder components and callbacks

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by