How to query whether event queue has been flushed

8 vues (au cours des 30 derniers jours)
Peter O'Connor
Peter O'Connor le 11 Fév 2011
I've got a callback function that's called Post-Set to the axes X-lim property. The Xlim is changed by everything, including title and xlabel, so I want this callback function only be active after everything is displayed (ie if the event queue has been flushed). Basically, I've got an if at the start of the callback function, and i need it to query whether matlab has displayed the plot and is just waiting, or is still running. It's just a boolean, and it should be somewhere, but I can't fine the damn thing!
Any ideas?
Thanks,
-Peter
  1 commentaire
Jimy Shah
Jimy Shah le 12 Fév 2011
DRAWNOW does not help? It should technically flush the event queue. If that's not helpful, can you send some example code demonstrating your issue?

Connectez-vous pour commenter.

Réponses (2)

Peter O'Connor
Peter O'Connor le 15 Fév 2011
Hey-- idea was not to flush the event queue, but to check if it had been flushed.
It was for an axes-limits listener callback, which plotted a different amount of data depending on the axes limits. Problem was a ton of functions (xlabel, label, title, etc..) slightly reset the axes limits, causing the callback to execute and the data to be recomputed like 20 times before the plot was even shown.
Ended up using sort of a hack to get around it with dbstack, only letting it through if the parent function was pan or zoom.
So, still an open question, and possibly a feature addition- how do you check the event queue?

Walter Roberson
Walter Roberson le 12 Fév 2011
You might be able to get somewhere by examining the output of dbstack

Catégories

En savoir plus sur Graphics Performance dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by