Borrar filtros
Borrar filtros

H must be the handle to a figure or figure descendent??

1 visualización (últimos 30 días)
Le Dung
Le Dung el 26 de Dic. de 2018
Respondida: Walter Roberson el 28 de Dic. de 2018
Hi everyone!
My problem is:
I have twos GUIs, GUI1 and GUI2.
GUI2 is sub - GUI of GUI1 that mean when i click on any component in GUI1, GUI2 will be opened
And, i want to use data in GUI1 for GUI2. i use code below in function GUI2_OpeningFcn(hObject, eventdata, handles, varargin) of GUI2
function GUI2_OpeningFcn(hObject, eventdata, handles, varargin):
hgui1 = findobj('Tag','gui1') % i set 'Tag' for GUI1 is "gui1'
if ~isempty(hgui1)
% get handles and other user-defined data associated to Gui1
gui1data = guidata(hgui1); % Store data from hgui1 to gui1data handle
end
guidata(hObject, handles);
when GUI2 runs, matla returns:
Error using guidata (line 87)
H must be the handle to a figure or figure descendent.
I don't know why?
Could you help me?
Please!

Respuestas (1)

Walter Roberson
Walter Roberson el 28 de Dic. de 2018
We have been discussing this in https://www.mathworks.com/matlabcentral/answers/11738-set-handles-of-another-gui#comment_654592 where I am waiting for your response on some debugging steps.
At the moment the difficulty is that your hgui1 is returning multiple figures. I need more information from you to figure out why it is happening.

Categorías

Más información sobre Graphics Object Identification en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by