How to save and restore entire GUI state in GUIDE?

7 ビュー (過去 30 日間)
ZedRedLed
ZedRedLed 2020 年 7 月 3 日
コメント済み: Rik 2020 年 7 月 7 日
I'm working on a large GUI in GUIDE with many different buttons, plots and popupmenus etc.. For the sake of error handling I would like to use try and catch statements to detect and output unexpected error messages. In combination with this, I would like to be able to backup the state of my entire GUI before I execute the code in a callback and then restore it if an error occurs.
Is there an efficient and general way to do this, without having to manually read out every component i alter?
I have tried working with findobj to automatically get all GUI Objects that fulfill different conditions to for example activate large parts of the GUI at once. This works well for specific cases like finding all deactivated UIControl Elements:
handles.InterfaceObjOff = findobj(handles.figure1, 'Enable', 'off', 'Visible', 'on', 'Type', 'UIControl');
but I am looking for something to read out everything, including entered values, strings in popupmenus, plotted lines etc. for different types of GUI elements.
I have also tried using guidata to backup the state of my GUI, but this does not work to actually restore the state of the GUI itself, only the variables stored within it.
Thanks in advance!
  1 件のコメント
Rik
Rik 2020 年 7 月 7 日
For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread.

サインインしてコメントする。

回答 (1 件)

Bhargavi Maganuru
Bhargavi Maganuru 2020 年 7 月 7 日
Hi,
You can write a custom function to save and restore GUI session.
You can refer this link, it might help you.

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by