Effacer les filtres
Effacer les filtres

SelectionChangeFcn not receiving handles

5 vues (au cours des 30 derniers jours)
Bob
Bob le 5 Juil 2011
I'm trying to have a gui (made using GUIDE) run some code when the selection of a radio button is changed.
The radio buttons are in a uipanel, I have added the following to the OpeningFcn:
set(handles.uipanel1,'SelectionChangeFcn',@uipanel1_SelectionChangeFcn);
and defined the SelectionChangeFcn as:
function uipanel1_SelectionChangeFcn(hObject, eventdata, handles)
who
However, the output of 'who' is:
Your variables are:
eventdata hObject
Is there a way to pass the handles structure to it too? I have a function that updates the gui, based on the contents of handles which I want to call from the SelectionChangeFcn.
Cheers

Réponse acceptée

Paulo Silva
Paulo Silva le 5 Juil 2011
set(handles.uipanel1,'SelectionChangeFcn',...{@uipanel1_SelectionChangeFcn,handles});
  1 commentaire
Bob
Bob le 5 Juil 2011
Spot on, thanks!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by