Borrar filtros
Borrar filtros

addlistener for an array

4 visualizaciones (últimos 30 días)
rmc256
rmc256 el 30 de Ag. de 2011
In a GUI, I would like a function to be called whenever a certain variable stored in "handles" is changed (handles.times lets say). I tried using addlistener() directly on an array, which doesn't work. I think I can create a class and do it that way, but it seems like a lot. I'm looking for SPECIFIC examples. Reasoning for this is I have a GUI that is a slave GUI to a master GUI. Whenever a certain value changes in the slave, I want it to automatically update the master GUI.

Respuestas (1)

Walter Roberson
Walter Roberson el 30 de Ag. de 2011
It might be easier to write a small wrapper routine such as
function handles = updatehandles(handles, field, value)
handles.(field) = value;
guidata(handles.mastergui, handles);
end
and then use updatehandles() instead of a plain assignment.

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by