Changing listbox max and min values from within a program (GUIDE)

3 vues (au cours des 30 derniers jours)
Tiburtius
Tiburtius le 3 Mar 2016
Commenté : Tiburtius le 3 Mar 2016
Hi!
I'm creating a GUI using GUIDE. Among other things, I will have a listbox whose items will change depending on user input. I would like to make it possible to make multiple selections in this listbox; in fact it should be possible to select all items. However, I can't set the max min values beforehand in GUIDE as the number of items in the listbox may change.
To further illustrate, let's say my program implements the phonebooks for all employees at a company. I have a global structure with all employees, each of which has a name and a cell array with the name of their contacts and a cell array with corresponding phone numbers. Let's say I have a popup menu where I can select one the employees. In my listbox, I would then like to display all the contacts of that employee. For example, I would then like to display (i.e. display()) the phone numbers for all selected contacts in that listbox.

Réponse acceptée

Adam
Adam le 3 Mar 2016
GUIDE GUI components are all stored in the 'handles' structure which is accessible in every (auto-generated) callback within your GUI. You should always give your components sensible tag names so you know how to access them again easy so e.g.
handles.listboxContacts.Max = 0;
  1 commentaire
Tiburtius
Tiburtius le 3 Mar 2016
Thanks! 'twas a silly question I guess, but I'm new to GUIDE.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB 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