필터 지우기
필터 지우기

Sharing data between GUI windows

조회 수: 1 (최근 30일)
Josef Rozinek
Josef Rozinek 2013년 6월 17일
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일
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.

카테고리

Help CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by