Thread Subject: uibuttongroup GUI

Subject: uibuttongroup GUI

From: James

Date: 30 Jun, 2009 18:26:01

Message: 1 of 4

My current GUI has a subGUI which pops up and contains a few different button groups. The selection of one of the radiobuttons in each group adds a different setting to a structure which the GUI is building using SelectionChangeFcn. This part works fine as long as I change the selected button from the default setting. If I do not change the radiobutton, SelectionChangeFcn does not execute (which it shouldn't). However, I need the GUI to recognize that the setting is the default selection and create the appropriate addition to my structure.

I have tried using the SelectedObject and setting it equal to [], however this doesn't work with the SelectionChangeFcn.

Any ideas?

Subject: uibuttongroup GUI

From: Travis

Date: 30 Jun, 2009 18:39:02

Message: 2 of 4

"James " <jamesmccurley@csufresno.edu> wrote in message <h2dlbp$alc$1@fred.mathworks.com>...
> My current GUI has a subGUI which pops up and contains a few different button groups. The selection of one of the radiobuttons in each group adds a different setting to a structure which the GUI is building using SelectionChangeFcn. This part works fine as long as I change the selected button from the default setting. If I do not change the radiobutton, SelectionChangeFcn does not execute (which it shouldn't). However, I need the GUI to recognize that the setting is the default selection and create the appropriate addition to my structure.
>
> I have tried using the SelectedObject and setting it equal to [], however this doesn't work with the SelectionChangeFcn.
>
> Any ideas?

You can try something like...

if ~exist('yourvariable','var')
yourvariable = 1;
end

or you can use ...

if isempty(yourvariable)
yourvariable = 1;
end

That is the only way around it I have found is to set the defaults later. If someone knows a way to get the value of check boxes/radio buttons when they have not been changed, please let us know.

Subject: uibuttongroup GUI

From: James

Date: 30 Jun, 2009 20:44:02

Message: 3 of 4

Should these methods work if the variable certain field within a structure? I cant seem to get them to work.

Thanks much

Subject: uibuttongroup GUI

From: Travis

Date: 30 Jun, 2009 22:14:01

Message: 4 of 4

"James " <jamesmccurley@csufresno.edu> wrote in message <h2dteh$780$1@fred.mathworks.com>...
> Should these methods work if the variable certain field within a structure? I cant seem to get them to work.
>
> Thanks much

to find a field within a structure use isfield(yourvariable,'fieldname') instead

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
uibuttongroup James 30 Jun, 2009 14:29:02
rssFeed for this Thread

Contact us at files@mathworks.com