Implementing button callbacks on a GUI

5 views
Skip to first unread message

MU Speech Lab

unread,
Jun 12, 2009, 4:19:19 PM6/12/09
to xbat-devel
Hello Harold/Matt,

I'm trying to build a GUI within XBAT which will contain some
pushbuttons. One of my problems is that when using a buttongroup, I
can't get more than one button to display and keep getting the error
below:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
??? Error using ==> set
Value must be a string, a function handle, or a cell array containing
string or
function handle

Error in ==> control_group at 1368
set(this_button, 'callback', this_callback);

Error in ==> browser_feature_menu at 551
pal = control_group(par, '', str, control, opt);

??? Error while evaluating uimenu Callback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

My code which creates the buttongroup is as follows:
control(end + 1) = control_create( ...
'name',{'new','delete'}, ...
'alias',{'New...','Delete...'}, ...
'style','buttongroup', ...
'width', 2/3,...
'space', 0.25 ...
);

This code is practically copy and pasted from the buttongroups on the
main pallet, but it won't work for me at all. For now, I have settled
to have the buttons just be on separate lines, but if you could help
me solve this problem I would greatly appreciate it.


The second (and larger) issue I'm having is that once I get buttons
onto the GUI, I am unable to make them respond to mouse click. I know
they require a callback, and that it belongs in a separate
parameter_control_callback file, but I can't figure out how to
structure this file or write the callback method.
Any help at all would be wonderful. Thanks for your time guys.

MU Speech Lab

unread,
Jul 9, 2009, 4:29:22 PM7/9/09
to xbat-devel
Solved the callback problem, still can't get multiple buttons to show
up though.
Reply all
Reply to author
Forward
0 new messages