Vous suivez désormais cette question
- Les mises à jour seront visibles dans votre flux de contenu suivi.
- Selon vos préférences en matière de communication il est possible que vous receviez des e-mails.
How to make an interactive panel for the user to chose among several options
Réponse acceptée
21 commentaires
- create graphics elements (possibly by loading .fig)
- if you have a backing MATLAB interactive session, you can return to the MATLAB prompt at this point if you want, leaving the GUI figure up; otherwise, uiwait() or waitfor() the GUI figure to be closed, after which you would close the GUI figure
- User moves and clicks and whatever, eventually triggering a callback that you have configured. Each callback runs, does whatever is appropriate, and the returns back to whatever the program was doing (possibly waiting, possibly processing a different routine.)
- if the callback is for chosing settings, then do whatever validation needed and when satisfied, either leave the GUI elements configured that way to be retrieved later or else store the results into a location you can get at afterwards; Share . Sometimes it makes sense that choosing a setting should enable further GUI elements, so you might either create those elements or have set them to be visible or enabled if you had created them before. For example if you were doing a polynomial fitting routine, then the 'FIT' action button should be disabled until the data has been chosen and the user has entered a polynomial degree.
- if the callback is for chosing files, then do whatever validation is needed and when satisfied, either leave the GUI elements configured that way to be retrieved later or else store the file name in a location you can get at afterwards or else load the file and store the useful information from it into a location you can get at afterwards, possibly displaying something as you go; Share. Sometimes it makes sense that choosing a file should enable further GUI elements, so you might either create those elements or have set them to be visible or enabled if you had created them before. For example if you were doing a polynomial fitting routine, then the 'FIT' action button should be disabled until the data has been chosen and the user has entered a polynomial degree.
- if the callback is something you have designed to signal that action should be taken, then gather the necessary settings and data from GUI elements or from the information you saved in the other callbacks, and process the data, outputting appropriate results, and possibly saving intermediate results into locations that you can get at afterwards; Share . Sometimes it makes sense that performing an action should enable further GUI elements, so you might either create those elements or have set them to be visible or enabled if you had created them before. For example if you were doing a polynomial fitting routine, then a request to display an optional error plot should be disabled until the user has run the fitting; if you were doing steganography, then the "Extract" action should possibly be disabled until the "Embed" action has been run (*or* the user has done a Load Embedded Image action.)
- create graphics elements inside a figure that was created as 'WindowStyle', 'modal', or make pre-created graphics elements visible
- uiwait() or waitfor() that figure to close or for a particular property of a graphics element to change or to become a particular value. With the 'modal' figure in effect, the user will not be permitted to interact with any other figure in the mean time
- destroy the graphics elements or make them hidden again to wait for next time
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Une erreur s'est produite
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asie-Pacifique
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)