필터 지우기
필터 지우기

if statement asking if an addlistener() event has occured

조회 수: 1 (최근 30일)
Adam Kaas
Adam Kaas 2012년 5월 21일
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