uitable multiple Callback - internally interruptible
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!