I am currently programming a guided user interface (GUI) in matlab which comprises a drop down menu.
When a certain element of the drop down menu is selected a second GUI is opened which contains a listbox. This listbox should now display data which have been been provided by the first GUI.
Passing the data to the second GUI works and I can update the handles variable accordingly. However I have problems to populate the listbox with the passed data because the handles in listbox1_CreateFcn(hObject, eventdata, handles) is empty:
% --- Executes during object creation, after setting all properties.
%function listbox1_CreateFcn(hObject, eventdata, handles)
% hObject handle to listbox1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: listbox controls usually have a white background on Windows.
% See ISPC and COMPUTER.
set(hObject,'String', handles.stringData); % THIS LINE DOES NOT WORK,
% BECAUSE handles is empty
if ispc && isequal(get(hObject,'BackgroundColor'), get (0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
Do you know a solution for my problem ?
Many thanks in advance, engineer.m