0

I use the inputdlg function to display a dialog box in which the user writes in several edit boxes. The number of boxes depends on the value of a variable, so I can have 3 ou 11 boxes but I figured out how to update the number of boxes in the dialog box according to the value of this variable.

Now I want to do the same thing with a GUI (and not a simple dialog box) because I would like to add some features in it (like a static text) by using uicontrol. (I'm forced to do that because it's impossible to extract the handle of the dialog box displayed by inputdlg). When you do it with GUIDE, you have to specify how many boxes you have but I can't give a fixed number of boxes, it's variable.

To sum up, I would like to dynamically increase the number of edit boxes in a GUI. How can I do that?

Coriolis
  • 396
  • 3
  • 10

2 Answers2

1

Suppose you want to use uicontrol.

The help is very comprehensive.

bdecaf
  • 4,652
  • 23
  • 44
0

Your best bet is to have a generic function that you can call with the necessary parameters to define the object you wish to create.

Something along the lines of this:

function CreateEditBox ( various parameters/necessary handles )
     set( objectHandle, 'Property', value ) 
     % and more for whatever it is you need to define.
end
Ben A.
  • 1,039
  • 6
  • 13