フィルターのクリア

Avoid interruptions in the callbacks for several controls

4 ビュー (過去 30 日間)
Diego Alonso
Diego Alonso 2013 年 3 月 6 日
I am building a GUI programmatically. In order to have data consistency, I want that all the uicontrol's don't interrupt a previously running callback function. In order to achieve so, I modify each uicontrol as:
set(hdl, 'BusyAction','cancel', 'Interruptible','off');
I want to configure all the uicontrol's at once. But there are not default value, like with the Units (DefaultUIControlUnits). Besides, they don't inherit this property from the parent control. Thus, is there any elegant way to do it?

採用された回答

Walter Roberson
Walter Roberson 2013 年 3 月 6 日
set( findobj( 'Type', 'uicontrol' ), 'Interruptible', 'off' )
  1 件のコメント
Diego Alonso
Diego Alonso 2013 年 3 月 7 日
It works!! I thought about this solution, but I assumed that it was going to be more time consuming, but it is actually quite fast. Thank you

サインインしてコメントする。

その他の回答 (1 件)

Daniel Shub
Daniel Shub 2013 年 3 月 6 日
Callbacks are only processed when the event queue is flushed. There are only a small number of things that can cause this (pause and drawnow). As long as you are careful to never flush the event queue, you won't get any interrupts.
  3 件のコメント
Diego Alonso
Diego Alonso 2013 年 3 月 7 日
Thank you. I indeed have drawnow() instructions.
Daniel Shub
Daniel Shub 2013 年 3 月 7 日
You can use drawnow('expose') to avoid flushing the event queue while still updating the screen.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by