Saving the State of a GUI
(Originally posted on Doug's MATLAB Video Tutorials blog.)
A question that comes across my inbox from time to time is how to save the state of a GUI between session. There are few methods for doing this, one is using the HGSAVE command to save the .FIG file for the GUI. This can be done in a way that modifies the original .FIG file, or you can save a different one. Another way is to explicitly query each of the UICONTROLS for their value and then save those values in a structure. You can later reload and set the values. Personally, I am very willing to do more typing to get explicit control over activities like this. The saved state .MAT file is very readable, and would allow you to save state that might not be reflected in the UICONTROLS. Also, this helps to keep the saved data separate from the files that create GUI components. The modular architecture is appealing. Finally, for people that are building their entire GUI programmatically (that is, using UICONTROL to position widgets instead of GUIDE) this method is really useful because you do not ever really load a .FIG file.
Also, be sure to take some time to explore the new look of the File Exchange. Lots of new features.
Recorded: 31 Oct 2008
Featured Product
MATLAB
Up Next:
Related Videos:
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)