Question

In my current project I have a bunch of edit text boxes in my gui. When I/m in the first text blank and hit the tab key it skips to the third text box, when I hit tab again it goes to the second box. Every time I hit tab it jumps around in this weird order. I found out that the order is dependent on the order of the callback function for each text box. Without going in an copy pasting and changing around the code that gets generated by guide is there a better way to order my text boxes. So for example when I'm in the box red x and hit tab it takes me to the box red z, than red y than green x then green z. I want to be able to click red x and then using just tab step through and fill out the other blocks. Is it at all possible to re-order?

enter image description here

Was it helpful?

Solution

GUIDE-generated GUI

When using GUIDE, you can simply use the "Tab Order Editor". Get to it using the following menu item:

enter image description here

For this simple GUI, with a single button and two text boxes, you would see the following dialog box:

enter image description here

Then set the tab order by moving UI objects up/down.


Programmatic GUI

To set the tab order programatically, you can use uistack to reorder the handles.

For example, to move a uicontrol "up" one in the order:

uistack(hui,'up',1)

To see the order of the handles to all controls in figure hf:

ch = get(hf,'Children')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top