From: Tao Song on 5 Jun 2010 09:59 Hi, I want to call a program immediately after the figure generated with GUIDE becomes visible. How can I do it? I know if I use GUIDE to crate a gui named test_gui and the function test_gui_OpeningFcn(hObject, eventdata, handles, varargin) is executed just before test_gui is made visible. I want to call a function after test_gui is made visible. Thanks for help! Regards, Tom
From: Matt Fig on 5 Jun 2010 10:09 Issue a DRAWNOW or PAUSE to force the figure to be drawn. Then call your other code.
From: Tao Song on 7 Jun 2010 21:30 Hi Matt, Do you know is there a callback function in which I can call drawnow? The callback generated by GUIDE is executed before the figure is visible. Thanks for help! Tom "Matt Fig" <spamanon(a)yahoo.com> wrote in message <hudlpv$ros$1(a)fred.mathworks.com>... > Issue a DRAWNOW or PAUSE to force the figure to be drawn. Then call your other code.
From: ImageAnalyst on 7 Jun 2010 21:42 Then try putting it in the yourGUIName_LayoutFunction() function. You'll also have to modify the line that says something like % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @yourGUIName_OpeningFcn, ... 'gui_OutputFcn', @yourGUIName_OutputFcn, ... 'gui_LayoutFcn', @yourGUIName_LayoutFunction, ... 'gui_Callback', []); which is the first and second line of code in your GUI's m-file. Of course, replace yourGUIName with the actual name of your GUI. Give that a try and see if it works. The layout function gets called after the OpeningFcn().
|
Pages: 1 Prev: bvp5c question Next: Find vector perpendicular to axis A and through point B |