Query event queue

조회 수: 4 (최근 30일)
Daniel Shub
Daniel Shub 2012년 5월 2일
댓글: Walter Roberson 2019년 9월 29일
Is it possible to query the event queue (i.e., where callbacks wait for drawnow)?
I have a for loop that takes a ~10 seconds to complete, during this time the user may initiate callbacks from a GUI. The operation of this loop is time sensitive, so I cannot interrupt the loop by completely flushing the event queue.
I have a complicated plan to use a timer object to implement a poor man version of thread switching. I don't want to do "thread switching" if there is no "second" thread, and I think I need to query the event queue to know that.

답변 (1개)

Hamid Ramezani
Hamid Ramezani 2019년 9월 29일
This might helo you. This bacically enables the event queue in matlab.
h = addlistener(src,'EventName',@callBackFunction);
h.Recursive = true;
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 9월 29일
How would you use that to query to find out how many items are on the queue?
Which EventName should be used? GUI interactions are mostly through the Callback property, but there are other important GUI interactions that operate through other callbacks such as WindowButtonPressFcn . The event names are unlikely to be the same for all of them; at the moment I do not know if any of them fire an Event when they occur.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by