admin管理员组

文章数量:1332382

I am attempting to create a MATLAB app programmatically to have it be more anized. As such I have split up code into different files based on what it does, I have one file to initialize the buttons on the screen. When I attempt to build a function callback for a button I seem to successfully build it. No errors are shown in the terminal, however I get an audible Windows Error noise and the callback action is not triggered. Here is my code:

function obj = selectLoad( grid )           
    %Create file load 1
    obj.fileLoad1 = uibutton(grid, 'push');
    obj.fileLoad1.FontSize = 36;
    obj.fileLoad1.Layout.Row = [8 9];
    obj.fileLoad1.Layout.Column = 1;
    obj.fileLoad1.Text = 'Load 1';
    obj.fileLoad1.ButtonPushedFcn = {@fileLoad1Callback}; 
end
function fileLoad1Callback(src, event)
    fileLoad1.Text = 'Ice Cream';
end

grid here is an argument I pass from my main initilization file that has the uigridlayout for the entire app. No error code is present so it is very difficult for me diagnose the issue.

本文标签: MATLAB Programmatic App Fcn Callback not workingStack Overflow