Another GUIDE question.
I created a GUIDE figure with a pop up menu. The elements of the menu are determined dynamically when calling the figure. Example: myGUI(data, popupNames)
should be called and then the strings included in popupNames should be used to label the choices. I am able to do that in the callback for the popup menu. However that means that the popup will not be populated until I actually press the on the popup menu and choose the first (curently empty) choice.
My question is how would I be able to populate it dynamically through the create function (or any other function). I also need to do the same thing with a uitable (populate the row and column names, though this one is not dynamic)
My failed attempt, which led me to realizing that I can't access the handle data in the create functions, was as follows:
% --- Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
handles.popupNames = varargin{2};
set(hObject, 'String', {handles.popupNames{1:end}});
% --- Executes during object creation, after setting all properties.
function uitable1_CreateFcn(hObject, eventdata, handles)
handles.data = varargin{1};
t = uitable(handles.uitable1);
set(t,'Data',handles.data{1})
set(t, 'ColumnName', {'a', 'b', 'c'})
set(t,'RowName', {'1', '2', '3'})