Reputation: 77
I am developing a program in which data needs to be displayed continously on the UI. I also have other modules to display, so I should be able to hide the table, while the script is running. My solution is to create an uitable that calls my script to get data and to set it 'visible','off'. Then, when the user clicks on a pushButton, the table sets to 'visible','on'. Here is my code:
function storageTest()
f = figure
t = uitable('parent',f, 'ColumnWidth',{50}, ...
'Position',[100 100 461 146],...
'Tag', 't',...
'visible','off');
pushBu = uicontrol('parent',f,...
'Style','pushbutton',...
'Callback',{@pushBu_Callback,t});
test(t) % My script
drawnow
function pushBu_Callback(hObject, callbackdata, x)
set(handles.x,'visible','on');
I have searched on forums and helped myself with this MATLAB documentation: unfortunately, it still does not work.
Upvotes: 0
Views: 285
Reputation: 77
Just found the answer, I should have written:
function pushBu_Callback(hObject, callbackdata, x)
set(x,'visible','on');
No need for handles!
Upvotes: 1