"K " <
dkkd...@walla.com> wrote in message <j9l9uv$lg9$
1...@newscl01ah.mathworks.com>...
Hello again,
Trying to follow your lead Phil.
I'm trying to implement a 3 push button group.
The push buttons should call the same callback function.
When activated, callback function should execute tasks based on the specific push button handle.
The problem is I do not know how to pass additional parameters to callback functions.
this is what I came with so far:
[code]
function exmpl()
close all;
plot(rand(1, 100), rand(1, 100), '.');
xlabel('wt [rad]');
ylabel('absolute value');
% Create the button group.
h = uibuttongroup('visible','off','Position',[0 0 1 0.04]);
% Create three radio buttons in the button group.
u0 = uicontrol('Style','pushbutton','String','Constructed selected points',...
'pos',[10 2 170 20],'parent',h,'HandleVisibility','off');
u1 = uicontrol('Style','pushbutton','String','Skip and close figure',...
'pos',[210 2 130 20],'parent',h,'HandleVisibility','off');
u2 = uicontrol('Style','pushbutton','String','Skip without close',...
'pos',[380 2 120 20],'parent',h,'HandleVisibility','off');
% Initialize some button group properties.
set(h,'SelectionChangeFcn',@pb_cbk);
% set(h,'SelectedObject',[]); % No selection
set(h,'Visible','on');
end
function pb_cbk(hObject,eventdata)
switch button_handle
case u0
...
...
end
[\code]