Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Static method in action callback

Subject: Static method in action callback

From: Neil

Date: 13 Sep, 2010 05:03:03

Message: 1 of 4

Hi

I am having some issues in setting a Static method in a post action callback on a class.

I'm doing

methods
      function callingmethod(this)
gihH = figure;
plot(rand(100));
set(zoom(figH),'ActionPostCallback', @this.AdaptiveDateTicks);
end
end

methods(Static)
function AdaptiveDateTicks2(~,eventObjectHandle)
end
end

When I zoom I get an error. If is use a normal method I don't. Any ideas?

Subject: Static method in action callback

From: Steven_Lord

Date: 13 Sep, 2010 13:55:58

Message: 2 of 4



"Neil " <neil.iain@gmail.com> wrote in message
news:i6kba7$s0u$1@fred.mathworks.com...
> Hi
> I am having some issues in setting a Static method in a post action
> callback on a class.
> I'm doing
> methods
> function callingmethod(this)
> gihH = figure;
> plot(rand(100));
> set(zoom(figH),'ActionPostCallback', @this.AdaptiveDateTicks);
> end
> end
>
> methods(Static)
> function AdaptiveDateTicks2(~,eventObjectHandle)
> end
> end
>
> When I zoom I get an error. If is use a normal method I don't. Any ideas?

What is the full text of the error message you received when you tried to
zoom after setting this callback?

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Static method in action callback

From: Neil

Date: 13 Sep, 2010 22:44:05

Message: 3 of 4

"Steven_Lord" <slord@mathworks.com> wrote in message <i6lahe$m9e$1@fred.mathworks.com>...
>
>
> "Neil " <neil.iain@gmail.com> wrote in message
> news:i6kba7$s0u$1@fred.mathworks.com...
> > Hi
> > I am having some issues in setting a Static method in a post action
> > callback on a class.
> > I'm doing
> > methods
> > function callingmethod(this)
> > gihH = figure;
> > plot(rand(100));
> > set(zoom(figH),'ActionPostCallback', @this.AdaptiveDateTicks);
> > end
> > end
> >
> > methods(Static)
> > function AdaptiveDateTicks2(~,eventObjectHandle)
> > end
> > end
> >
> > When I zoom I get an error. If is use a normal method I don't. Any ideas?
>
> What is the full text of the error message you received when you tried to
> zoom after setting this callback?
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

Hey Steve,

The error message is:
 In DataItem>@(varargin)this.AdaptiveDateTicks(varargin{:}) at 309
  In hgfeval at 63
  In uitools.uimode.fireActionPostCallback at 11
  In zoom>local2DButtonUpFcn at 1332
  In hgfeval at 63
  In uitools.uimode.modeWindowButtonUpFcn at 46
  In uitools.uimode.setCallbackFcn>localModeWindowButtonUpFcn at 58
Warning: An error occurred during the mode callback.
> In uitools.uimode.fireActionPostCallback at 14
  In zoom>local2DButtonUpFcn at 1332
  In hgfeval at 63
  In uitools.uimode.modeWindowButtonUpFcn at 46
  In uitools.uimode.setCallbackFcn>localModeWindowButtonUpFcn at 58

Subject: Static method in action callback

From: Neil

Date: 14 Sep, 2010 00:56:04

Message: 4 of 4

"Neil " <neil.iain@gmail.com> wrote in message <i6m9fl$mbc$1@fred.mathworks.com>...
> "Steven_Lord" <slord@mathworks.com> wrote in message <i6lahe$m9e$1@fred.mathworks.com>...
> >
> >
> > "Neil " <neil.iain@gmail.com> wrote in message
> > news:i6kba7$s0u$1@fred.mathworks.com...
> > > Hi
> > > I am having some issues in setting a Static method in a post action
> > > callback on a class.
> > > I'm doing
> > > methods
> > > function callingmethod(this)
> > > gihH = figure;
> > > plot(rand(100));
> > > set(zoom(figH),'ActionPostCallback', @this.AdaptiveDateTicks);
> > > end
> > > end
> > >
> > > methods(Static)
> > > function AdaptiveDateTicks2(~,eventObjectHandle)
> > > end
> > > end
> > >
> > > When I zoom I get an error. If is use a normal method I don't. Any ideas?
> >
> > What is the full text of the error message you received when you tried to
> > zoom after setting this callback?
> >
> > --
> > Steve Lord
> > slord@mathworks.com
> > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
> > To contact Technical Support use the Contact Us link on
> > http://www.mathworks.com
>
> Hey Steve,
>
> The error message is:
> In DataItem>@(varargin)this.AdaptiveDateTicks(varargin{:}) at 309
> In hgfeval at 63
> In uitools.uimode.fireActionPostCallback at 11
> In zoom>local2DButtonUpFcn at 1332
> In hgfeval at 63
> In uitools.uimode.modeWindowButtonUpFcn at 46
> In uitools.uimode.setCallbackFcn>localModeWindowButtonUpFcn at 58
> Warning: An error occurred during the mode callback.
> > In uitools.uimode.fireActionPostCallback at 14
> In zoom>local2DButtonUpFcn at 1332
> In hgfeval at 63
> In uitools.uimode.modeWindowButtonUpFcn at 46
> In uitools.uimode.setCallbackFcn>localModeWindowButtonUpFcn at 58
I have sorted it out. The above method seems to work

Tags for this Thread

No tags are associated with this thread.

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.

Contact us