Hello , I'm doing a master degree in physics and I have the need to program a GUI to do certain theoretical calculations and plot graphs. In this GUI there are 3 tabs, I need to be able to know when the selected tab is changed. There is a SelectionChangedFcn when a tab group is created… Well… first of all this is the initial code that is executed before the GUI is made visible:
% Create tab group
handles.tgroup = uitabgroup('Parent', handles.figure1,'TabLocation', 'top');handles.tab1 = uitab('Parent', handles.tgroup, 'Title', 'Materials and Optics selection');handles.tab2 = uitab('Parent', handles.tgroup, 'Title', 'Dispersion graphs');handles.tab3 = uitab('Parent', handles.tgroup, 'Title', 'My Tab Label 3');%Create a handle for the selection change function of the tab group
tgroup.SelectionChangedFcn = @tabChangedCB;% Place panels into each tab
set(handles.uipanel1,'Parent',handles.tab1)set(handles.uipanel2,'Parent',handles.tab2)set(handles.uipanel3,'Parent',handles.tab3)% Reposition each panel to same location as panel 1
set(handles.uipanel2,'position',get(handles.uipanel1,'position'));set(handles.uipanel3,'position',get(handles.uipanel1,'position'));
In the first lines the tab group is created, I have noticed that when using guide all the objects appear in the object browser… BUT tgroup DOES NOT appear in the object browser… so I cannot set the SelectionChangedFcn in the property inspector of tgroup because I cannot browse it… Does anybody have any idea how this can be done..??
Best Answer