How to let user update popmenu string and add some code in popmenu?

1 vue (au cours des 30 derniers jours)
Lai man
Lai man le 16 Oct 2018
Modifié(e) : Lai man le 16 Oct 2018
When I push one radiobutton the edit_text(add one selection to my popmenu string) and button(confirm adding) it will display(already does), so I need to increase my switch case or change some thing in popmenu code when user increase one popmenu opotion does it possibility? (my english is poor sorry)
ex:
before
contents = get(hObject, 'Value');
switch contents
case 1 return 1;
end
user add one
after
contents = get(hObject, 'Value');
switch contents
case 1 return 1;
case 2 return 2;
end
Does it possibility?
  4 commentaires
Walter Roberson
Walter Roberson le 16 Oct 2018
after
contents = get(hObject, 'Value');
switch contents
case 1 return 1;
case 2 return 2;
end
Why not just return what is in contents ?
Note: you cannot return anything from these kinds of callbacks; you can only store a value somewhere that other code can find the value.
Lai man
Lai man le 16 Oct 2018
Modifié(e) : Lai man le 16 Oct 2018
I know how to do, I am fixate on using switch case and I forget contents it will be change .... (thanks for your help and reply

Connectez-vous pour commenter.

Réponses (0)

Catégories

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by