callback in umenue as {@Myfunc, Arg1, Arg2, Arg3}
However it’s forming correct structure, it’s giving wrong function arguments in all Octave versions.
{@Myfanc} without arguments is working Okay
I suppose you are setting a 'callback'
property of an uimenu
graphics object.
Please note that (most) callbacks are always called with two arguments: the handle to the graphics object for which it is called and an (empty) structure with eventData.
If you want to pass the three arguments Arg1
, Arg2
and Arg3
to a callback function using the cell syntax, make sure the callback function accepts the correct arguments.
E.g.:
function MyFunc(h, eventData, Arg1, Arg2, Arg3)
disp('Calling MyFunc');
end
Alternatively, use anonymous functions to redirect the callback to a function with arbitrary prototype:
uimenu(..., 'Callback', @(h,e) MyFunc(Arg1, Arg2, Arg3));
HTH