|
"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.
|