Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to remove accidentally created radiobutton Callback?

Subject: How to remove accidentally created radiobutton Callback?

From: Richard Crozier

Date: 11 Oct, 2011 10:29:10

Message: 1 of 3

I have a gui I've been working on which has a button group with two radiobuttons. Obviously these call the SelectionChangeFcn when they change selection.

I hadn't worked on it for a while and had forgotten this and right clicked on one of the radiobuttons and chose the go to Callback option from the context menu which created a callback for the button. Now, although the selected button changes when I click on it, the SelectionChangeFcn is never called.

How exactly do I restore the previous functionality?

I tried deleting the callback code from the mfile, but this causes an error when starting the GUI. I also tried selecting the radiobutton in GUIDE and clicking on the Callback field in the property inspector. Doing this switches focus to the editor and opens the file 'guidefunc.m' I cannot therefore change this property.

Subject: How to remove accidentally created radiobutton Callback?

From: Richard Crozier

Date: 11 Oct, 2011 10:52:10

Message: 2 of 3

"Richard Crozier" wrote in message <j715pm$5f2$1@newscl01ah.mathworks.com>...
> I have a gui I've been working on which has a button group with two radiobuttons. Obviously these call the SelectionChangeFcn when they change selection.
>
> I hadn't worked on it for a while and had forgotten this and right clicked on one of the radiobuttons and chose the go to Callback option from the context menu which created a callback for the button. Now, although the selected button changes when I click on it, the SelectionChangeFcn is never called.
>
> How exactly do I restore the previous functionality?
>
> I tried deleting the callback code from the mfile, but this causes an error when starting the GUI. I also tried selecting the radiobutton in GUIDE and clicking on the Callback field in the property inspector. Doing this switches focus to the editor and opens the file 'guidefunc.m' I cannot therefore change this property.


ok, I solved the problem by creating a duplicate of the original radiobutton, deleting the original, then renaming the new radiobutton to the same as the original.

Subject: How to remove accidentally created radiobutton Callback?

From: ade77

Date: 11 Oct, 2011 14:41:11

Message: 3 of 3

"Richard Crozier" wrote in message <j7174q$9da$1@newscl01ah.mathworks.com>...
> "Richard Crozier" wrote in message <j715pm$5f2$1@newscl01ah.mathworks.com>...
> > I have a gui I've been working on which has a button group with two radiobuttons. Obviously these call the SelectionChangeFcn when they change selection.
> >
> > I hadn't worked on it for a while and had forgotten this and right clicked on one of the radiobuttons and chose the go to Callback option from the context menu which created a callback for the button. Now, although the selected button changes when I click on it, the SelectionChangeFcn is never called.
> >
> > How exactly do I restore the previous functionality?
> >
> > I tried deleting the callback code from the mfile, but this causes an error when starting the GUI. I also tried selecting the radiobutton in GUIDE and clicking on the Callback field in the property inspector. Doing this switches focus to the editor and opens the file 'guidefunc.m' I cannot therefore change this property.
>
>
> ok, I solved the problem by creating a duplicate of the original radiobutton, deleting the original, then renaming the new radiobutton to the same as the original.

That is the problem when u use GUIDE, u have no flexibility(control). try to learn how to create the GUI programmatically.

meanwhile, whenever u create a buttongroup, for u to select any of the radio button without error, u must have the SelectionChangeFcn in the code, u do not have to write anything within it, but u must have it on the file, so that when u click a different button(within the buttongroup), that function is called.
I am not too sure, but u might also need to activate the CreateFcn of that button group when using GUIDE.
From ur post, what u are doing is trial and error, and most likely u will run into a frustrating problem sooner or later.
Good luck

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us