if statement asking if an addlistener() event has occured

2 次查看(过去 30 天)
Is there a way to write an if statement that says something like:
if % addlistener(handles.Edit1, 'String','PostGet',f) occured %do something end

采纳的回答

Sean de Wolski
Sean de Wolski 2012-5-21
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 个评论
Walter Roberson
Walter Roberson 2012-5-22
Your handles must have been associated with a different figure number I guess.
Sean de Wolski
Sean de Wolski 2012-5-22
or improperly GUIDATAed (new verb!). That is why I avoid GUIDATA like the plague.

请先登录,再进行评论。

更多回答(1 个)

Walter Roberson
Walter Roberson 2012-5-21
Have the listener set a variable in an area you can test.
  1 个评论
Adam Kaas
Adam Kaas 2012-5-21
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by