필터 지우기
필터 지우기

How to change tab group order in AppDesigner

조회 수: 6 (최근 30일)
Pavel
Pavel 2017년 1월 30일
답변: Jessica Hiscocks 2018년 6월 10일
I'm creating an application using App Designer in 2016b, I'm finishing up the project just to realize that I can't simply drag and drop tabs in a tab group to change the order. After looking through tab group documentation there doesn't seem to be a parameter that changes the tab order. Also I cannot find any tab order variables/methods in the setup portion of the code. I am most likely missing something obvious, so any insight is much appreciated.

답변 (5개)

Sally Al Khamees
Sally Al Khamees 2017년 2월 1일
The ability to reorder tabs in a tab group is not currently available using the App Designer graphical interface; however, it is possible to do this programmatically. The "Children" property of a Tab Group object is an array that contains the Tab objects inside the Tab Group, and the order of the Tab objects within this array corresponds to the order that the tabs are displayed in the GUI. Therefore, if you reorder the Tab objects within the "Children" property, this will change the order in which the tabs are displayed.
  댓글 수: 1
James Ryan
James Ryan 2017년 10월 10일
I have the same problem.
I can order the tabs at run time with the sort of ugly code below, but they stay out of order in the App Designer gui. If I could just drag and drop 3 lines of the greyed-out code in Code View everything would be okay. I see that the mlapp file is not in plain text, presumably to save me from the sin of hand-editing it.
Is there any way to get the gui to show the right thing?
tabs = app.TabGroup.Children;
ttab = tabs(5);
tabs(5) = tabs(4);
tabs(4) = ttab;
app.TabGroup.Children = tabs;

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


Palmi Thor Thorbergsson
Palmi Thor Thorbergsson 2017년 10월 12일
Hi! I just ran into this problem when adding a new tab that I wanted to appear in the second spot. My solution (using the app-designer GUI) was to first create the new tab, then cut and paste the already existing tabs that I wanted to move to the right of the new tab. Seems to work just fine. I guess the only risk with this solution is that you might accidentally put something else in the clipboard before pasting a tab that you just cut. However, if you happen to do that, you can undo the cutting in the GUI. /Palmi
  댓글 수: 1
Palmi Thor Thorbergsson
Palmi Thor Thorbergsson 2017년 10월 12일
Just a little update: I just found out that the callback associations disappeared when doing the above. The callbacks are still defined, so if you know which callback should be associated with each element, this can easily be recovered. /Palmi

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


Melissa Williams
Melissa Williams 2017년 10월 16일
Hello, In R2017b interactively dragging and dropping to reorder tabs is now supported in App Designer.
  댓글 수: 1
Michael Amonson
Michael Amonson 2018년 2월 28일
I'm running R2017b and I still can't drag and drop in the Component Browser or the Code Browser to reorder the callbacks. Are you running some sort of beta version of R2017b? I can't believe this is so difficult! This is a huge oversight. There should be an easy way of allowing the user to reorder the callbacks. Please provide some insight/guidance as to what I can do to organize the callbacks.

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


BAHADI Zouhair
BAHADI Zouhair 2018년 4월 10일
In fact you can do it easily by copying the tabs to which you want to change the order and then you paste them in the right place. Then you remove the tabs that are not in their place and then you go to the tab that you moved you right click on the bontons to which you have already made the callback and then you put select existing callback and you associate it with the good callback that you have already written and here everything should work after that .

Jessica Hiscocks
Jessica Hiscocks 2018년 6월 10일
A better approach in 2016b: create a second tab group off to the side. Without copy/paste, drag the components to the dummy tab. Delete/rename the empty original tabs to get the order you want. Drag everything back. If you do this, callbacks seem to be preserved.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by