app designer button callback stopped working suddenly

28 views (last 30 days)
Hi All,
I was working on a new app on app designer and it worked fine until suddenly the push buttons callbeck stopped working and errors appeared on the command window. I tried to open a new app and the errors repeat even on a new app with only one state button.
These are the errors I get on the command window every time I push the button:
Warning: Error occurred while executing the
listener callback for event GuiEvent defined
for class
appdesservices.internal.peermodel.ServerDrivenPeerNodeProxyView:
Undefined function or variable 'sd'.
Error in
matlab.ui.control.internal.controller.ComponentController/executeUserCallback
(line 340)
sd
Error in
matlab.ui.control.internal.controller.ComponentController/handleUserInteraction
(line 285)
obj.executeUserCallback(callbackInfo{:});
Error in
matlab.ui.control.internal.controller.BinaryComponentController/handleEvent
(line 55)
obj.handleUserInteraction('ValueChanged',
{'ValueChanged', eventData,
'PrivateValue', newValue});
Error in
matlab.ui.control.internal.controller.StateButtonController/handleEvent
(line 63)
handleEvent@matlab.ui.control.internal.controller.BinaryComponentController(obj,
src, event);
Error in
appdesservices.internal.interfaces.controller.AbstractController/handleProxyViewEvent
(line 279)
handleEvent(obj, src,
event);
Error in
appdesservices.internal.interfaces.controller.AbstractController>@(src,event)handleProxyViewEvent(obj,src,event)
Error in
appdesservices.internal.interfaces.view.AbstractProxyView/notify
(line 117)
obj.notify@handle(varargin{:});
Error in
appdesservices.internal.peermodel.PeerNodeProxyView/handlePeerEventFromClient
(line 214)
notify(obj, 'GuiEvent',
eventData);
Error in
appdesservices.internal.peermodel.PeerNodeProxyView>@(varargin)obj.handlePeerEventFromClient(varargin{:})
(line 78)
obj.PeerEventListener =
addlistener(obj.PeerNode,
'peerEvent',
@obj.handlePeerEventFromClient);
Error in hgfeval (line 62)
feval(fcn{1},varargin{:},fcn{2:end});
Error in javaaddlistener>cbBridge (line 52)
hgfeval(response, java(o), e.JavaEvent)
Error in
javaaddlistener>@(o,e)cbBridge(o,e,response)
(line 47)
@(o,e)
cbBridge(o,e,response));
The code is the app designer templet for new app with one callback defined for the state button:
classdef IE_Data_Plotter < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
Button matlab.ui.control.StateButton
end
% Callbacks that handle component events
methods (Access = private)
% Value changed function: Button
function ButtonValueChanged(app, event)
value = app.Button.Value;
end
end
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Create UIFigure and hide until all components are created
app.UIFigure = uifigure('Visible', 'off');
app.UIFigure.Position = [100 100 767 577];
app.UIFigure.Name = 'UI Figure';
% Create Button
app.Button = uibutton(app.UIFigure, 'state');
app.Button.ValueChangedFcn = createCallbackFcn(app, @ButtonValueChanged, true);
app.Button.Text = 'Button';
app.Button.Position = [167 321 100 22];
% Show the figure after all components are created
app.UIFigure.Visible = 'on';
end
end
% App creation and deletion
methods (Access = public)
% Construct app
function app = IE_Data_Plotter
% Create UIFigure and components
createComponents(app)
% Register the app with App Designer
registerApp(app, app.UIFigure)
if nargout == 0
clear app
end
end
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
delete(app.UIFigure)
end
end
end

Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!