From: Philip on
I have a reset button in my gui. Currently, I have all the code in my openingfcn within the reset buttons functions. Is there a way to just call the openingfcn?

Thanks,
Phil
From: Walter Roberson on
Philip wrote:
> I have a reset button in my gui. Currently, I have all the code in my
> openingfcn within the reset buttons functions. Is there a way to just
> call the openingfcn?

Yes, it is allowed to use the same callback for two purposes, and it is also
allowed to have one callback call the routine associated with another callback.
From: Philip on
Thanks, Walter.

How do I do this?
From: Walter Roberson on
Philip wrote:
> Thanks, Walter.
>
> How do I do this?

resethandle = uicontrol('Style','pushbutton',
'Position',AppropriatePositionHere, 'Callback', {@openingfcn});

Or, alternately, if you have code before the openingfcn should be invoked,
(such as if you confirm with the user that they really want to reset before
you do it), then in your callback for the push button, just call openingfcn,
probably passing it the same parameters that the pushbutton was given:

openingfcn(hObject, eventstructure, handles); %sample call
From: Philip on
Walter Roberson <roberson(a)hushmail.com> wrote in message <hsi2v9$gnl$1(a)canopus.cc.umanitoba.ca>...
> Philip wrote:
> > Thanks, Walter.
> >
> > How do I do this?
>
> resethandle = uicontrol('Style','pushbutton',
> 'Position',AppropriatePositionHere, 'Callback', {@openingfcn});
>
> Or, alternately, if you have code before the openingfcn should be invoked,
> (such as if you confirm with the user that they really want to reset before
> you do it), then in your callback for the push button, just call openingfcn,
> probably passing it the same parameters that the pushbutton was given:
>
> openingfcn(hObject, eventstructure, handles); %sample call

Sorry, I am still pretty new to matlab. So resethandle is my buttons handle? also, what is position referring to? And lastly, I place that within my reset button's function. right?