Al momento, stai seguendo questa domanda
- Vedrai gli aggiornamenti nel tuofeed del contenuto seguito.
- Potresti ricevere delle e-mail a seconda delle tuepreferenze per le comunicazioni.
How to make an interactive panel for the user to chose among several options
Risposta accettata
21 Commenti
- 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
Più risposte (0)
Vedere anche
Categorie
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Si è verificato un errore
Impossibile completare l'azione a causa delle modifiche apportate alla pagina. Ricarica la pagina per vedere lo stato aggiornato.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)
Asia-Pacifico
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)