Periodically Updated Static Text and Reading from Key-Value File
Afficher commentaires plus anciens
I have two questions concerning a GUI application I'm writing:
- Is it possible to code a static text label so it periodically updates itself (from a database, or whatever) without interfering with the execution of the main application? The label would be used to cycle through news, updates, etc. That sort of thing.
- Currently, my application sets user-supplied variables by running a script, generate_appvars. I'll be compiling soon, but want to preserve this method of reading in run params at runtime. I was thinking a key-value params file which I can read into a dynamically named struct, but am unsure of how to handle vector and cell assignments (k/v pairs key = [1, 3, 5] or key = {'this', 'that'} for instance). Thinking of using eval for the right hand assignment, but don't think it's the best solution. How do other people handle runtime parameters like this?
Thanks!
Réponse acceptée
Plus de réponses (2)
Walter Roberson
le 22 Sep 2011
1 vote
1. No -- background activity always interferes with the execution of the main application.
Perhaps for your purposes it would be acceptable to code a timer whose callback fetched the data and set() the text control to the new content.
2. regexp() can help with the parsing -- though matching apostrophes can be a pain if your strings are allowed to include apostrophes.
Catégories
En savoir plus sur MATLAB Compiler dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!