I'm working at GUI in MATLAB application.
I use uitable
object. Then I find interesting undocumented feature how to sort it's data, select whole row and etc.
I do this way:
% create jhandle to my uitable object
juiTable = findjobj(handles.uitable1,'class','UIScrollPane');
jtable = juiTable(1).getComponent(0).getComponent(0);
%... some my action like this:
jtable.setRowSelectionAllowed(true);
%...
%and now lets try use callback for selected cell in uitable:
juiFunHandle = handle(jtable, 'CallbackProperties');
set(juiFunHandle, 'MousePressedCallback', @CellSelectionCallback);
set(juiFunHandle, 'KeyPressedCallback', @CellSelectionCallback);
That works perfectly.
Now question: how to put multiple parameters to CellSelectionCallback
?
I want this function makes some action (makes some button active etc).
For this I try to put GUI handles
to it. But how?
My CellSelectionCallback
function:
function CellSelectionCallback(juiTable, varargin)
% get it from the example
row = get(juiTable,'SelectedRow')+1;
fprintf('row #%d selected\n', row);
P.S. I see varargin
into it. So can I use multiple arguments? How to put it using my set
function??