Borrar filtros
Borrar filtros

if statement asking if an addlistener() event has occured

1 visualización (últimos 30 días)
Is there a way to write an if statement that says something like:
if % addlistener(handles.Edit1, 'String','PostGet',f) occured %do something end

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 21 de Mayo de 2012
I don't really understand why you would want to do this. The purpose of the listener is to fire when something (some event) happens. Why then do you need an if()? When this something happens, the listener will fire and your if() will happen automagically.
  13 comentarios
Walter Roberson
Walter Roberson el 22 de Mayo de 2012
Your handles must have been associated with a different figure number I guess.
Sean de Wolski
Sean de Wolski el 22 de Mayo de 2012
or improperly GUIDATAed (new verb!). That is why I avoid GUIDATA like the plague.

Iniciar sesión para comentar.

Más respuestas (1)

Walter Roberson
Walter Roberson el 21 de Mayo de 2012
Have the listener set a variable in an area you can test.
  1 comentario
Adam Kaas
Adam Kaas el 21 de Mayo de 2012
So could I use an expression such as
addlistener(handles.Edit1, 'String', 'PostGet', n=1);
then test my n variable? I tried it and it doesn't like the expression at all and I can't find any documentation why.

Iniciar sesión para comentar.

Categorías

Más información sobre Interactive Control and Callbacks 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