Use ActionPostCallback on zoom object causing IuserException.

10 visualizaciones (últimos 30 días)
Tobias Stängle
Tobias Stängle el 19 de Oct. de 2020
Editada: Mario Malic el 19 de Oct. de 2020
I am currently trying to write a script which executes a function on zoom. This is just a simple test from me.
mapFigure = figure();
plot(x,y);
zoomObj = zoom(mapFigure);
zoomObj.ActionPostCallback = @(zoomObject, evd) newRenderImage(zoombOject,evd);
zoomObj.Enable = 'on';
And I call this from an livescript
myFig = getMyFigure(x,y);
This is the error it produces
Error in matlab.ui.internal.componentframework.WebControllerFactory/create (line 92)
checkPreconditions( obj, component, parentController, nargin );]
MathWorks::System::IUserException [Error using matlab.ui.internal.componentframework.WebControllerFactory/checkPreconditions (line 45)
Invalid superclass name.
Anyone has a workaround for this problem?

Respuestas (1)

Mario Malic
Mario Malic el 19 de Oct. de 2020
Morning,
Looks like issue might be with this letter
@(zoomObject, evd) newRenderImage(zoombOject,evd);
% ^
  2 comentarios
Tobias Stängle
Tobias Stängle el 19 de Oct. de 2020
If i try it in a normal matlab scrip it works. Trying it in a live script cauises this error:
Error in matlab.ui.internal.componentframework.WebControllerFactory/create (line 92)
checkPreconditions( obj, component, parentController, nargin );]
MathWorks::System::IUserException [Error using matlab.ui.internal.componentframework.WebControllerFactory/checkPreconditions (line 45)
Invalid superclass name.
Mario Malic
Mario Malic el 19 de Oct. de 2020
Editada: Mario Malic el 19 de Oct. de 2020
Documentation of
doc matlab.ui.internal.componentframework.WebControllerFactory/Create
Number of input arguments to the "createController" function is 3.
I would suggest to go into debugging mode and see the differences between the livescript and script, so you can check the issue yourself. There might be some unexpected differences between the two. I haven't used livescript so can't really address the issue.
One of these probably cause the issue: obj, component, parentController. Probably the last one.
Hint on the
zoomObj.ActionPostCallback = @(zoomObject, evd) newRenderImage(zoombOject,evd);
You should check how the original ActionPostCallback works. Your anonymous function might not have access to usual

Iniciar sesión para comentar.

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by