Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: GUIDE GUI :: Callback Event :: Outside of gui
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Matlab User

Posts: 14
Registered: 8/23/11
GUIDE GUI :: Callback Event :: Outside of gui
Posted: Jan 4, 2013 12:01 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Using GUIDE I have developed a GUI that I have called "myGUI" -- GUIDE thus created two files, myGUI.m and myGUI.fig.

The GUI controls the collection of measurement data and allows the user to enter various input parameters which are stored in structures. Once data has been collected and stored in one of these structures, it shall then be processed and the result of the processing be displayed in the GUI.

However, as the GUI already contains many lines of code, I wish to keep my data processing functions in a separate file. I have therefore created a new function which I have called runGUI,m. This function calls myGUI and obtains its handles and data as follows:

myGuiFigure = myGUIi();
myGuiHandlesi = guihandles(myGuiFigure);
myGuiData = guidata(myGuiFigure);

I can then access the data stored in the structure using something like:

measurement1 = myGuiData.measurementData{1}

All of the above is working okay and I can access all of the data and the handles as I wish.

As explained, myGUI controls the collection of measurement data and thus includes pushbuttons 'Start' and 'Stop'. However, it is not obvious to me how I should program runGUI.m so that it knows that the pushbuttons have been pressed or, for that matter, when any of the user controls has been changed.

I have searched through TMW and other websites without much success. Some postings talk about "addlistener" but I am not sure if this is the correct approach. Any help would be much appreciated. Thanks in advance.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.