Sharing data between GUI windows

I am working on a GUI for an instrument. The instrument is accessed via serial communication.
My question is, what is the easiest way to share data between GUI windows?
Say I have a main GUI window, where I press the 'settings' button which pops out sub-GUI. In settings I define the serial communication attributes and set the serial interface via a 'connect' button. Then I return back to the main GUI window and I would like to use the previously set attributes further to send/receive messages to the instrument. That has to be done using the fprintf command, with the parameters set in the sub-GUI window.
Any suggestions? Thanks in advance
Cheers
Josef

回答 (1 件)

Jan
Jan 2013 年 6 月 17 日

0 投票

When the "settings" button is pressed in the main GUI, forward the handle of this GUI to sub-GUI. When the sub-GUI is closed, use guidata() to write the values from the sub-GUI to the handles struct (or any other ApplicationData) of the main-GUI.
Sharing data between GUIs is discussed frequently. Searching in this forum allows you to find more details.

カテゴリ

ヘルプ センター および File ExchangeInstrument Control Toolbox Supported Hardware についてさらに検索

質問済み:

2013 年 6 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by