uitable multiple Callback - internally interruptible

1 visualización (últimos 30 días)
Smattering_Applause
Smattering_Applause el 20 de Sept. de 2021
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?

Respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by