Creating Graphical User Interfaces |
|
Setting the Tab Order Programmatically
You can set the tab order programmatically by reordering the children in the Children
property of the figure or of a container such as a uipanel.
Note
The order in which the uicontrols appear in a child list is the reverse of the order in which they tab. This order also reflects the order in which the controls stack visually. I.e., if two components overlap, the item that appears first in the list shows up on top.
|
- Get the vector of children of the GUI figure with a command similar to
- Permute the
HandlesOfChildren
vector to suit your needs. For instance, to reverse the tab order:
- Reassign the permuted vector to the
Children
property of the figure:
Note
You can only assign a vector which is a permutation of the vector of children in this manner; you can't, for example, do the following because 0 is not the handle of a child of the figure:
set(HandleOfFigure,'Children',[0 HandlesOfChildren(2:end)]);
|
| Setting the Tab Order | | Programming GUIs | |
© 1994-2005 The MathWorks, Inc.