i have to create a GUI that adapts to the users input! So if the user puts is a 5, i would like to have five aligned checkboxes and edit textboxes. The names of the static textboxes as well as the Tags of the checkboxes shall be dependent of the input number given by the user. And i woould like to pack it into a panel.
I created this code:
stages = 5;
fig = figure('Visible','off');
box = zeros(stages,1);
txtbox = zeros(stages,1);
panel = uipanel('parent',fig,...
'Title','Choose stages to plot',...
'position',[.01 .05 .25 .95]);
for i = 1:stages
box(i,1) = uicontrol('parent',panel,'style','checkbox',...
'position',[20 360-i*25 40 20],...
txtbox = uicontrol(fig,'Style','text',...
'Position',[100 360-i*25 40 20]);
Some questions to it.
1) How can i put the static text into the panel and align it with the checkboxes? i cannot find the order of input arguments for uicontrol so i dont know where to put 'parent' and panel as arguments.
2) How can i tag the checkboxes according to the number...so first checkbox shall have the tag 'checkbox1', the second 'checkbox2' and so on....
3) Is it possible to make the GUI window adapt to the number of created checkboxes so that it resizes in order to make all checkboxes visible or that the user is able to scroll down?
I know those are many questions:( i would be very glad to get answers!
Best regards, John