Thread Subject: connecting 2 GUIs

Subject: connecting 2 GUIs

From: Ebrahim Jeddi

Date: 2 Jan, 2008 08:15:49

Message: 1 of 10

I want to call a gui (built by codes) using a push button in
another gui (built by guide) but I get this error:

Output argument "XYfinal" (and maybe others) not assigned
during call to "C:\Documents and
Settings\Ibo\Desktop\GUI\domain_definition.m
(domain_definition)".

Where is the problem?

Subject: connecting 2 GUIs

From: Huy

Date: 2 Jan, 2008 08:27:42

Message: 2 of 10

"Ebrahim Jeddi" <ejeddi@gmail.com> wrote in message
<flfh7l$q5l$1@fred.mathworks.com>...
> I want to call a gui (built by codes) using a push button in
> another gui (built by guide) but I get this error:
>
> Output argument "XYfinal" (and maybe others) not assigned
> during call to "C:\Documents and
> Settings\Ibo\Desktop\GUI\domain_definition.m
> (domain_definition)".
>
> Where is the problem?

Try using the function uiwait.

The .m file domain_definition.m should get and return the
handle of figure that it creates.

  fig = domain_definition;

  ...
   
  uiwait(fig)
  ...

Anh Huy Phan
RIKEN - BSI

Subject: connecting 2 GUIs

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 2 Jan, 2008 08:55:01

Message: 3 of 10

In article <flfh7l$q5l$1@fred.mathworks.com>,
Ebrahim Jeddi <ejeddi@gmail.com> wrote:
>I want to call a gui (built by codes) using a push button in
>another gui (built by guide) but I get this error:

>Output argument "XYfinal" (and maybe others) not assigned
>during call to "C:\Documents and
>Settings\Ibo\Desktop\GUI\domain_definition.m
>(domain_definition)".

>Where is the problem?

We have no idea where the problem is (and I believe the other
posters suggestion of uiwait() is irrelevant to the problem.)

Your function domain_definition is not assigning a value to all
of its output arguments (the names before the '=' in the 'function'
line), but the calling routine has an output variable in the
corresponding position and so requires that the value be defined
by the function.

domain_definition.m is not provided by Matlab, so we have no idea
what the code in it looks like, and no idea what the routine is
intended to do. You also did not provide any context code, so we
do not have any idea what arguments you are passing when you
invoke domain_definition().

It is as if you asked us, "I named my car Frodo. The
trouble light comes on in the car. What is the problem?" without
giving us any information about the make or age of the car or how
you had been driving it or its repair history, or any odd noises
you had been hearing, or any steering problems, etc., and you are
expecting us to be able to tell you "Oh, you must have a 1968
Ford Fiesta, and when you make the left hand turn and start going
up a hill that is between 1.8 and 2.1 kilometers away from where you
started the car, the car is warning you that you are low on
brake fluid in the front-right brake."

You wrote the code; you've told us essentially nothing about it;
we can't tell you *why* the problem is occuring! Read your code!
Put in breakpoints and trace the code and figure out *why* you
are not assigning a value to XYfinal.
--
  "There are some ideas so wrong that only a very intelligent person
  could believe in them." -- George Orwell

Subject: connecting 2 GUIs

From: Ebrahim Jeddi

Date: 2 Jan, 2008 08:56:28

Message: 4 of 10

Thanks for the reply
Mesh_console is my main GUI and domain_definition is a gui
that when the user pushes a push button on the main gui is
called.

the code was working well but when I developed the
domain_definition gui and had to use the handle of its
figure in the code this error started

I tried to handle with the way that you told but I think
when we create gui with guide it's a bit different.

The hanlde of domain_definition is my_h and now the main gui
says that the my_h is unknown. How can I introduce this
handle to the main gui?

Subject: connecting 2 GUIs

From: Ebrahim Jeddi

Date: 2 Jan, 2008 10:26:09

Message: 5 of 10

Here is the code for domain_definition. This gui should be
called by a push button in mesh_console gui and trasnfer the
XYfinal (coordinates of xy) to mesh_console when we select 4
points on it.
The code works very well by itself:

function [XYfinal]=domain_definition

my_h=figure('Name','Input_Using_GUI',...
    'Numbertitle','off',...
    'WindowButtonDownFcn',@clickButtonDown,...
    'WindowButtonMotionFcn',@buttonMotion,...
    'Position',[100 100 700 600]);

%movegui(my_h,'center')
axes_feedback=axes('Units','normalized', ...
    'Position', [0.1 0.9 0.7 0.1]);
axis([0 100 0 20]);
axis off
text(0,5,...
    'To change the value of snap, release the Snap Grid
toggle button',...
    'color','b','fontsize',12);

axes_zone=axes('Units','normalized', ...
    'Position', [0.1 0.1 0.7 0.7]);
axis([0 100 0 100]);
hold on


% text boxes to show x/y or vertex id
xy_txt = uicontrol('Style','text', ...
    'Units','normalized', ...
    'Position',[0 0 1 0.05], ...
    'FontSize',11, ...
    'FontWeight','b', ...
        'Callback',@click_xy_txt,...
    'BackgroundColor',[0.8 0.8 0.8]);

% check box and text box for latching x/y points (snap grid)
lpanel = uipanel('BackgroundColor',[0.9 0.9 0.9], ...
    'Position',[0.82 0.55 0.17 0.25]);
snap_edt = uicontrol(lpanel, ...
    'Style','edit', ...
    'String','10', ...
    'Units','normalized', ...
    'Position', [0.05 0.65 0.9 0.25], ...
    'BackgroundColor',[1 1 1],...
    'enable','off');
snap_chk = uicontrol(lpanel, ...
    'Style','togglebutton', ...
    'String','Snap Grid', ...
    'Value',1, ...
    'Units','normalized', ...
    'Position', [0.05 .05 0.9 0.22], ...
    'BackgroundColor',[0.9 0.9 0.9],...
    'callback',@pressreq);
grid_chk = uicontrol(lpanel, ...
    'Style','togglebutton', ...
    'String','Show Grid', ...
    'Value',0, ...
    'Units','normalized', ...
    'Position', [0.05 .35 0.9 0.22], ...
    'BackgroundColor',[0.9 0.9 0.9],...
    'callback',@ShowGrid);
pb_close=uicontrol( 'Style','pushbutton', ...
    'String','Close', ...
    'Value',0, ...
    'Units','normalized', ...
    'Position', [0.82 .28 0.17 0.1], ...
    'BackgroundColor',[0.9 0.9 0.9],...
    'callback',@ClickClose);
pb_try_again=uicontrol( 'Style','pushbutton', ...
    'String','Try Again', ...
    'Value',0, ...
    'Units','normalized', ...
    'Position', [0.82 .4 0.17 0.1], ...
    'BackgroundColor',[0.9 0.9 0.9],...
    'callback',@ClickTryAgain);

[X]=[];
[Y]=[];

i=0;
n=4;



%%
        function clickButtonDown(varargin)
            if i<n
                 pt = get(gca,'CurrentPoint');
                 pt=[pt(1,1),pt(2,2)];
                 x=pt(1,1);
                 y=pt(1,2);
                 zonechk=zone_check(x,y);
                 if zonechk==0
                     errordlg('You must select a point
within the area of the axes');
                 else
                     if get(snap_chk,'Value')
                         snap =
str2double(get(snap_edt,'String'));
                         if ~isnan(snap)
                             pt = round(pt/snap)*snap;
                             x=pt(1,1);
                             y=pt(1,2);
                         end
                     end
                             
                     i=i+1;
                     axes(axes_feedback);
                     if i==1
                     cla
                     end
                     text(25*(i-1),15,mat2str(['Point '
num2str(i)]),...
                         'color','b','fontsize',12);
                      text(25*(i-1),7,mat2str(['x= '
num2str(x)]));
                      text(25*(i-1),0,mat2str(['y= '
num2str(y)]));

                      axes(axes_zone);
                      X=[X,x(length(x))];
                      Y=[Y,y(length(y))];
                      XY=[X;Y]';
                      if i==n
                          XYfinal=XY;
                      end
                      adjn=adjacency(i);
                      if i==n
                          adjn(1,n)=1;
                          adjn(n,1)=1;
                      end
                      cla
                      gplot(adjn,XY,'.-');
                      label(i,XY);
                 end
            end
        end
%% building adjacency matrix
         function [adjn]=adjacency(n)
             adjn=zeros(n);
             if n==1
                 adjn=1;
             else
                 for a=2:n-1
                     adjn(a,a+1)=1;
                     adjn(a,a-1)=1;
                 end
                 adjn(1,2)=1;
                 adjn(n,n-1)=1;
             end
         end
%%
         function pt = getPoint()
             pt = get(gca,'CurrentPoint');
             pt=[pt(1,1),pt(2,2)];
             if get(snap_chk,'Value')
                 snap = str2double(get(snap_edt,'String'));
                 if ~isnan(snap)
                      pt = round(pt/snap)*snap;
                 end
             end
         end
%% Labeling points
         function label(i,XY)
              for j=1:i
                 
text(XY(j,1),XY(j,2),num2str(j),'fontsize',12,'fontweight','b','color','m')
              end
         end

%% To check for clicking within the axes
         function zonechk=zone_check(x,y)
             if x>100 || x<0 || y>100 ||y<0
                 zonechk=0;
             else
                 zonechk=1;
             end
         end
%%
         function buttonMotion(varargin)
               pt = getPoint();
               P= get(gca,'CurrentPoint');
              zonechk=zone_check(P(1,1),P(1,2));
              if zonechk==1
                  set(my_h,'Pointer','fullcrosshair');
              else
                  set(my_h,'Pointer','arrow');
              end
              set(xy_txt,'String',[' x = ' num2str(pt)
'=y']);
         end
%%
         function ClickClose(varargin)
           delete(gca,my_h)
         end
%%
         function ClickTryAgain(varargin)
           delete(gca,my_h)
           domain_definition
         end
%%
         function ShowGrid(varargin)
             if get(grid_chk,'Value')
                 grid on
             else
                 grid off
             end
         end
%%
         function pressreq(varargin)
                 if get(snap_chk,'Value')
                     set(snap_edt,'enable','off')
                 else
                     set(snap_edt,'enable','on')
                 end
         end
                 

%%
end








roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <flfjh5$srj$1@canopus.cc.umanitoba.ca>...
> In article <flfh7l$q5l$1@fred.mathworks.com>,
> Ebrahim Jeddi <ejeddi@gmail.com> wrote:
> >I want to call a gui (built by codes) using a push button in
> >another gui (built by guide) but I get this error:
>
> >Output argument "XYfinal" (and maybe others) not assigned
> >during call to "C:\Documents and
> >Settings\Ibo\Desktop\GUI\domain_definition.m
> >(domain_definition)".
>
> >Where is the problem?
>
> We have no idea where the problem is (and I believe the other
> posters suggestion of uiwait() is irrelevant to the problem.)
>
> Your function domain_definition is not assigning a value
to all
> of its output arguments (the names before the '=' in the
'function'
> line), but the calling routine has an output variable in the
> corresponding position and so requires that the value be
defined
> by the function.
>
> domain_definition.m is not provided by Matlab, so we have
no idea
> what the code in it looks like, and no idea what the
routine is
> intended to do. You also did not provide any context code,
so we
> do not have any idea what arguments you are passing when you
> invoke domain_definition().
>
> It is as if you asked us, "I named my car Frodo. The
> trouble light comes on in the car. What is the problem?"
without
> giving us any information about the make or age of the car
or how
> you had been driving it or its repair history, or any odd
noises
> you had been hearing, or any steering problems, etc., and
you are
> expecting us to be able to tell you "Oh, you must have a 1968
> Ford Fiesta, and when you make the left hand turn and
start going
> up a hill that is between 1.8 and 2.1 kilometers away from
where you
> started the car, the car is warning you that you are low on
> brake fluid in the front-right brake."
>
> You wrote the code; you've told us essentially nothing
about it;
> we can't tell you *why* the problem is occuring! Read your
code!
> Put in breakpoints and trace the code and figure out *why* you
> are not assigning a value to XYfinal.
> --
> "There are some ideas so wrong that only a very
intelligent person
> could believe in them." --
George Orwell

Subject: connecting 2 GUIs

From: Huy

Date: 2 Jan, 2008 10:43:46

Message: 6 of 10

The variable my_h should be defined in the output.

function [my_h, XYfinal]=domain_definition
 my_h=figure('Name','Input_Using_GUI',...
     'Numbertitle','off',...
     'WindowButtonDownFcn',@clickButtonDown,...
     'WindowButtonMotionFcn',@buttonMotion,...
     'Position',[100 100 700 600]);

.....

Anh Huy Phan
RIKEN - BSI

"Ebrahim Jeddi" <ejeddi@gmail.com> wrote in message
<flfos1$ib8$1@fred.mathworks.com>...
> Here is the code for domain_definition. This gui should be
> called by a push button in mesh_console gui and trasnfer the
> XYfinal (coordinates of xy) to mesh_console when we select 4
> points on it.
> The code works very well by itself:
>
> function [XYfinal]=domain_definition
>
> my_h=figure('Name','Input_Using_GUI',...
> 'Numbertitle','off',...
> 'WindowButtonDownFcn',@clickButtonDown,...
> 'WindowButtonMotionFcn',@buttonMotion,...
> 'Position',[100 100 700 600]);
>
> %movegui(my_h,'center')
> axes_feedback=axes('Units','normalized', ...
> 'Position', [0.1 0.9 0.7 0.1]);
> axis([0 100 0 20]);
> axis off
> text(0,5,...
> 'To change the value of snap, release the Snap Grid
> toggle button',...
> 'color','b','fontsize',12);
>
> axes_zone=axes('Units','normalized', ...
> 'Position', [0.1 0.1 0.7 0.7]);
> axis([0 100 0 100]);
> hold on
>
>
> % text boxes to show x/y or vertex id
> xy_txt = uicontrol('Style','text', ...
> 'Units','normalized', ...
> 'Position',[0 0 1 0.05], ...
> 'FontSize',11, ...
> 'FontWeight','b', ...
> 'Callback',@click_xy_txt,...
> 'BackgroundColor',[0.8 0.8 0.8]);
>
> % check box and text box for latching x/y points (snap grid)
> lpanel = uipanel('BackgroundColor',[0.9 0.9 0.9], ...
> 'Position',[0.82 0.55 0.17 0.25]);
> snap_edt = uicontrol(lpanel, ...
> 'Style','edit', ...
> 'String','10', ...
> 'Units','normalized', ...
> 'Position', [0.05 0.65 0.9 0.25], ...
> 'BackgroundColor',[1 1 1],...
> 'enable','off');
> snap_chk = uicontrol(lpanel, ...
> 'Style','togglebutton', ...
> 'String','Snap Grid', ...
> 'Value',1, ...
> 'Units','normalized', ...
> 'Position', [0.05 .05 0.9 0.22], ...
> 'BackgroundColor',[0.9 0.9 0.9],...
> 'callback',@pressreq);
> grid_chk = uicontrol(lpanel, ...
> 'Style','togglebutton', ...
> 'String','Show Grid', ...
> 'Value',0, ...
> 'Units','normalized', ...
> 'Position', [0.05 .35 0.9 0.22], ...
> 'BackgroundColor',[0.9 0.9 0.9],...
> 'callback',@ShowGrid);
> pb_close=uicontrol( 'Style','pushbutton', ...
> 'String','Close', ...
> 'Value',0, ...
> 'Units','normalized', ...
> 'Position', [0.82 .28 0.17 0.1], ...
> 'BackgroundColor',[0.9 0.9 0.9],...
> 'callback',@ClickClose);
> pb_try_again=uicontrol( 'Style','pushbutton', ...
> 'String','Try Again', ...
> 'Value',0, ...
> 'Units','normalized', ...
> 'Position', [0.82 .4 0.17 0.1], ...
> 'BackgroundColor',[0.9 0.9 0.9],...
> 'callback',@ClickTryAgain);
>
> [X]=[];
> [Y]=[];
>
> i=0;
> n=4;
>
>
>
> %%
> function clickButtonDown(varargin)
> if i<n
> pt = get(gca,'CurrentPoint');
> pt=[pt(1,1),pt(2,2)];
> x=pt(1,1);
> y=pt(1,2);
> zonechk=zone_check(x,y);
> if zonechk==0
> errordlg('You must select a point
> within the area of the axes');
> else
> if get(snap_chk,'Value')
> snap =
> str2double(get(snap_edt,'String'));
> if ~isnan(snap)
> pt = round(pt/snap)*snap;
> x=pt(1,1);
> y=pt(1,2);
> end
> end
>
> i=i+1;
> axes(axes_feedback);
> if i==1
> cla
> end
> text(25*(i-1),15,mat2str(['Point '
> num2str(i)]),...
> 'color','b','fontsize',12);
> text(25*(i-1),7,mat2str(['x= '
> num2str(x)]));
> text(25*(i-1),0,mat2str(['y= '
> num2str(y)]));
>
> axes(axes_zone);
> X=[X,x(length(x))];
> Y=[Y,y(length(y))];
> XY=[X;Y]';
> if i==n
> XYfinal=XY;
> end
> adjn=adjacency(i);
> if i==n
> adjn(1,n)=1;
> adjn(n,1)=1;
> end
> cla
> gplot(adjn,XY,'.-');
> label(i,XY);
> end
> end
> end
> %% building adjacency matrix
> function [adjn]=adjacency(n)
> adjn=zeros(n);
> if n==1
> adjn=1;
> else
> for a=2:n-1
> adjn(a,a+1)=1;
> adjn(a,a-1)=1;
> end
> adjn(1,2)=1;
> adjn(n,n-1)=1;
> end
> end
> %%
> function pt = getPoint()
> pt = get(gca,'CurrentPoint');
> pt=[pt(1,1),pt(2,2)];
> if get(snap_chk,'Value')
> snap = str2double(get(snap_edt,'String'));
> if ~isnan(snap)
> pt = round(pt/snap)*snap;
> end
> end
> end
> %% Labeling points
> function label(i,XY)
> for j=1:i
>
>
text(XY(j,1),XY(j,2),num2str(j),'fontsize',12,'fontweight','b','color','m')
> end
> end
>
> %% To check for clicking within the axes
> function zonechk=zone_check(x,y)
> if x>100 || x<0 || y>100 ||y<0
> zonechk=0;
> else
> zonechk=1;
> end
> end
> %%
> function buttonMotion(varargin)
> pt = getPoint();
> P= get(gca,'CurrentPoint');
> zonechk=zone_check(P(1,1),P(1,2));
> if zonechk==1
> set(my_h,'Pointer','fullcrosshair');
> else
> set(my_h,'Pointer','arrow');
> end
> set(xy_txt,'String',[' x = ' num2str(pt)
> '=y']);
> end
> %%
> function ClickClose(varargin)
> delete(gca,my_h)
> end
> %%
> function ClickTryAgain(varargin)
> delete(gca,my_h)
> domain_definition
> end
> %%
> function ShowGrid(varargin)
> if get(grid_chk,'Value')
> grid on
> else
> grid off
> end
> end
> %%
> function pressreq(varargin)
> if get(snap_chk,'Value')
> set(snap_edt,'enable','off')
> else
> set(snap_edt,'enable','on')
> end
> end
>
>
> %%
> end
>
>
>
>
>
>
>
>
> roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
> message <flfjh5$srj$1@canopus.cc.umanitoba.ca>...
> > In article <flfh7l$q5l$1@fred.mathworks.com>,
> > Ebrahim Jeddi <ejeddi@gmail.com> wrote:
> > >I want to call a gui (built by codes) using a push button
in
> > >another gui (built by guide) but I get this error:
> >
> > >Output argument "XYfinal" (and maybe others) not assigned
> > >during call to "C:\Documents and
> > >Settings\Ibo\Desktop\GUI\domain_definition.m
> > >(domain_definition)".
> >
> > >Where is the problem?
> >
> > We have no idea where the problem is (and I believe the
other
> > posters suggestion of uiwait() is irrelevant to the
problem.)
> >
> > Your function domain_definition is not assigning a value
> to all
> > of its output arguments (the names before the '=' in the
> 'function'
> > line), but the calling routine has an output variable in the
> > corresponding position and so requires that the value be
> defined
> > by the function.
> >
> > domain_definition.m is not provided by Matlab, so we have
> no idea
> > what the code in it looks like, and no idea what the
> routine is
> > intended to do. You also did not provide any context code,
> so we
> > do not have any idea what arguments you are passing when you
> > invoke domain_definition().
> >
> > It is as if you asked us, "I named my car Frodo. The
> > trouble light comes on in the car. What is the problem?"
> without
> > giving us any information about the make or age of the car
> or how
> > you had been driving it or its repair history, or any odd
> noises
> > you had been hearing, or any steering problems, etc., and
> you are
> > expecting us to be able to tell you "Oh, you must have a
1968
> > Ford Fiesta, and when you make the left hand turn and
> start going
> > up a hill that is between 1.8 and 2.1 kilometers away from
> where you
> > started the car, the car is warning you that you are low on
> > brake fluid in the front-right brake."
> >
> > You wrote the code; you've told us essentially nothing
> about it;
> > we can't tell you *why* the problem is occuring! Read your
> code!
> > Put in breakpoints and trace the code and figure out *why*
you
> > are not assigning a value to XYfinal.
> > --
> > "There are some ideas so wrong that only a very
> intelligent person
> > could believe in them." --
> George Orwell
>

Subject: connecting 2 GUIs

From: Ebrahim Jeddi

Date: 2 Jan, 2008 10:52:21

Message: 7 of 10

I have done this before but I again gave it a try and again
got the same error message. I think my_h by itself cannot be
recognized by the main GUI.

FYI the call back function is:

% --- Executes on button press in pb_input_using_GUI.
function pb_input_using_GUI_Callback(hObject, eventdata,
handles)
% hObject handle to pb_input_using_GUI (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see GUIDATA)

[my_h,XYfinal]=domain_definition;
[coordinates]=auto_nomination(XYfinal);


    set(handles.xA,'String',coordinates(1));
    set(handles.yA,'String',coordinates(2));
    set(handles.xB,'String',coordinates(3));
    set(handles.yB,'String',coordinates(4));
    set(handles.xC,'String',coordinates(5));
    set(handles.yC,'String',coordinates(6));
    set(handles.xD,'String',coordinates(7));
    set(handles.yD,'String',coordinates(8));
    guidata(hObject,handles) %see GUI Data in help

Subject: connecting 2 GUIs

From: Huy

Date: 2 Jan, 2008 11:15:12

Message: 8 of 10

Hi Ebrahim Jeddi,

Put this line

uiwait(my_h);

at the end of main function.

%%%%%%%%%%%%%
function [XYfinal]=domain_definition

my_h=figure('Name','Input_Using_GUI',...
    'Numbertitle','off',...
    'WindowButtonDownFcn',@clickButtonDown,...
    'WindowButtonMotionFcn',@buttonMotion,...
    'Position',[100 100 700 600]);

%movegui(my_h,'center')

...
...
...

i=0;
n=4;

uiwait(my_h);

    function clickButtonDown(varargin)
        if i<n
       ...
    end
    ....

end

Anh Huy Phan
RIKEN - BSI

"Ebrahim Jeddi" <ejeddi@gmail.com> wrote in message
<flfqd5$bg3$1@fred.mathworks.com>...
> I have done this before but I again gave it a try and again
> got the same error message. I think my_h by itself cannot be
> recognized by the main GUI.
>
> FYI the call back function is:
>
> % --- Executes on button press in pb_input_using_GUI.
> function pb_input_using_GUI_Callback(hObject, eventdata,
> handles)
> % hObject handle to pb_input_using_GUI (see GCBO)
> % eventdata reserved - to be defined in a future version of
> MATLAB
> % handles structure with handles and user data (see
GUIDATA)
>
> [my_h,XYfinal]=domain_definition;
> [coordinates]=auto_nomination(XYfinal);
>
>
> set(handles.xA,'String',coordinates(1));
> set(handles.yA,'String',coordinates(2));
> set(handles.xB,'String',coordinates(3));
> set(handles.yB,'String',coordinates(4));
> set(handles.xC,'String',coordinates(5));
> set(handles.yC,'String',coordinates(6));
> set(handles.xD,'String',coordinates(7));
> set(handles.yD,'String',coordinates(8));
> guidata(hObject,handles) %see GUI Data in help

Subject: connecting 2 GUIs

From: Ebrahim Jeddi

Date: 2 Jan, 2008 21:46:17

Message: 9 of 10

Hello Huy,

I ONLY add uiwait(my_h) before
clickButtonDown(varargin)function and it worked as what I
wanted. We did not need to add the function to the main
function. You're the man, thanks!!!

uiwait(my_h);
function clickButtonDown(varargin)

But I am wondering how we can add our own function to a GUI
created by GUIDE, I tried it sometimes but it always failed.

Subject: connecting 2 GUIs

From: M K

Date: 3 Jan, 2008 14:46:33

Message: 10 of 10


> But I am wondering how we can add our own function to a GUI
> created by GUIDE, I tried it sometimes but it always failed.

Addressing only the last part of your discussion, you should
be able to add any function you'd like at the bottom of the
main GUI code generated by GUIDE. Alternativly if you used
the "property editor" to change the 'tag' property of the
buttons you created in GUIDE to what you'd like the callback
function to be named, GUIDE will automatically adjust the
callback function accordingly.

MK

Tags for this Thread

Everyone's Tags:

gui

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
gui Ebrahim Jeddi 2 Jan, 2008 03:20:05
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com