uitable multiple Callback - internally interruptible

5 ビュー (過去 30 日間)
Smattering_Applause
Smattering_Applause 2021 年 9 月 20 日
I have an issue with 2 uitable callbacks and the interruptible setting. Below is a sample bit of code for the creation of the uitable. As you can see, Interruptible is off, BusyAction is cancel, Columns are editable.
xInput = uitable(...
'Parent' ,d ,...
'CellEditCallback' ,@cell_manually_edited ,...
'CellSelectionCallback' ,@update_selected_cell ,...
'KeyPressFcn' ,@paste_checker ,...
'Interruptible' ,'off' ,...
'BusyAction' ,'cancel' ,...
'ColumnEditable' ,true );
pastechecker looks for the combination of ctrl+v and then pop up a questdlg() to confirm the action (in case of accident since ctrl+z won't work). This questdlg contains a uiwait which goes to a waitfor, and that causes interrupts to be able to execute. As a result of the user hitting ctrl+v the CellEditCallback was queued up so when the waitfor occurs in the questdlg, we pop over and execute cell_manually_edited. It seems like the Interruptible and BusyAction settings only affect Callbacks from other UIControls rather than also affecting internal Callbacks.
The only way I have seen to get around this is to run dbstack and then scan the function names to see if we were earlier executing paste_checker. (For future updates I think I could likely take the pasted char array from that cell, decode it (tabs, newlines, etc to get an array), then overwrite cells in the table as needed, but the main question below still stands...)
Is there a way to prevent Interruption by UIControl internal Callbacks, or is the property only available for blocking other UIControls?

回答 (0 件)

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by