【发布时间】:2020-06-19 15:32:05
【问题描述】:
在此功能(应用程序设计器)中,我在使用鼠标左键选择时删除表格中的一行,如何使用右键或其他键+鼠标组合而不是左键进行选择?
代码:
% Cell selection callback: infoTable
function infoTableCellSelection(app, event)
indices = event.Indices;
data = app.infoTable.Data;
row = indices(:,1);
figSelect = uifigure;
figSelect.SelectionType ='alt';
selection = uiconfirm(figSelect,'Delete row?','Confirm Close',...
'Icon','question');
disp(selection);
disp(figSelect.SelectionType);
switch selection
case 'OK'
app.infoTable.Data(row,:) = [];
close(figSelect);
case 'Cancel'
close(figSelect);
return
end
后面的代码:
function createComponents(app)
...
app.infoTable.CellSelectionCallback = createCallbackFcn(app, @infoTableCellSelection, true);
【问题讨论】:
标签: matlab matlab-app-designer