uitable multiple Callback - internally interruptible

조회 수: 1 (최근 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 CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by