|
|
Call GUI function from another GUI
Hello!
I have 2 GUI, big Main with set of functions and small showdata, which is opened by button in the Main. I use handles of main GUI, as arguments
showdata('main', handles.Main);
So I have access to handles of main GUI, but I also want to use function of main GUI, e.g. I have function in the Main GUI
function slice=GetSlice(hslider)
slice=ceil(get(hslider,'Value'));
I'm trying to call it from showdata GUI
handles.Image = varargin{2};
mainImage=guidata(handles.Image);
zslice=GetSlice(mainImage.ZSlider);
And I have error
??? Undefined function or method 'GetSlice' for input
arguments of type 'double'.
How can I call this function?
Thanks
|
|
0
|
|
|
|
Reply
|
Elena
|
9/8/2010 9:24:20 PM |
|
"Elena " <e.e.belova@gmail.com> wrote in message <i68uu4$6g$1@fred.mathworks.com>...
> Hello!
> I have 2 GUI, big Main with set of functions and small showdata, which is opened by button in the Main. I use handles of main GUI, as arguments
>
> showdata('main', handles.Main);
>
> So I have access to handles of main GUI, but I also want to use function of main GUI, e.g. I have function in the Main GUI
>
> function slice=GetSlice(hslider)
> slice=ceil(get(hslider,'Value'));
>
> I'm trying to call it from showdata GUI
> handles.Image = varargin{2};
> mainImage=guidata(handles.Image);
> zslice=GetSlice(mainImage.ZSlider);
>
> And I have error
> ??? Undefined function or method 'GetSlice' for input
> arguments of type 'double'.
>
> How can I call this function?
>
> Thanks
First: Don't name your variable 'slice' as this is a MATLAB stock function.
Second: Rewrite GetSlice where you're calling it from and use setappdata/getappdata to pass the handles between the GUIs.
|
|
0
|
|
|
|
Reply
|
Sean
|
9/8/2010 9:55:20 PM
|
|
|
1 Replies
476 Views
(page loaded in 0.229 seconds)
Similiar Articles: Call GUI function from another GUI - comp.soft-sys.matlab ...Call GUI function from another GUI - comp.soft-sys.matlab ... calling openingfcn to reset GUI - comp.soft-sys.matlab Call GUI function from another GUI - comp.soft ... Open one GUI from another GUI - comp.soft-sys.matlabCall GUI function from another GUI - comp.soft-sys.matlab ... Open one GUI from another GUI - comp.soft-sys.matlab Call GUI function from another GUI - comp.soft-sys.matlab ... calling openingfcn to reset GUI - comp.soft-sys.matlabCall GUI function from another GUI - comp.soft-sys.matlab ... calling openingfcn to reset GUI - comp.soft-sys.matlab Call GUI function from another GUI - comp.soft-sys ... Calling VB script from Matlab GUI - comp.soft-sys.matlab ...Call GUI function from another GUI - comp.soft-sys.matlab ... calling openingfcn to reset GUI - comp.soft-sys.matlab Call GUI function from another GUI - comp.soft ... reset callback in GUI - comp.soft-sys.matlabCall GUI function from another GUI - comp.soft-sys.matlab ... reset callback in GUI - comp.soft-sys.matlab... comp.soft-sys.matlab Hi ... for Graphic User Interface ... Passing data from Gui to seperate m.file - comp.soft-sys.matlab ...Call GUI function from another GUI - comp.soft-sys.matlab ..... soft ... Hi ... for Graphic User Interface ... use input from GUI to run another .m file, show output in GUI ... Calling an .m file from GUI - comp.soft-sys.matlabCall GUI function from another GUI - comp.soft-sys.matlab ... use input from GUI to run another .m file, show output in GUI ... Call GUI function from another GUI - comp ... GUI, timer, handles - comp.soft-sys.matlabCall GUI function from another GUI - comp.soft-sys.matlab ... GUI, timer, handles - comp.soft-sys.matlab GUI, timer, handles - comp.soft-sys.matlab Call GUI function from ... Passing variables between GUI calback functions - comp.soft-sys ...Call GUI function from another GUI - comp.soft-sys.matlab ..... getappdata to ... read data back so the GUI can see it? Are timer functions run ... Graphical User Interface ... use input from GUI to run another .m file, show output in GUI ...Call GUI function from another GUI - comp.soft-sys.matlab ... use input from GUI to run another .m file, show output in GUI ... Call GUI function from another GUI - comp ... Call GUI function from another GUI - Newsreader - MATLAB CentralFile exchange, MATLAB Answers, newsgroup access, Links, and Blogs for the MATLAB & Simulink user community Call GUI function from another GUI - comp.soft-sys.matlab ...Call GUI function from another GUI - comp.soft-sys.matlab ... calling openingfcn to reset GUI - comp.soft-sys.matlab Call GUI function from another GUI - comp.soft ... 7/22/2012 5:25:13 PM
|
|
|
|
|
|
|
|
|