I've created a small GUI to manipulate data and recently I decided to move the database to a MySQL server. I created a Java program to bring the data back and forth and I started to notice the delay when access servers abroad.
When you run scripts through the command window Matlab displays a "busy" text in the lower left corner but not when I'm running GUIs.
So how do I know if Matlab is busy when using GUIs?
Thanks in advance.
Edit: Quick example.
I run in the command window (or a script test.m)
for i = 1:100000
a = i+i;
disp(a);
end
The status bar says "Busy".
When I create a GUI, with the button "Click me" that executes the same exact script. The busy sign on the status bar does not appear.
Why is this and what can I do about it? I want to be able to see if my GUI is busy or not.
It says so in the status bar of the main window!
EDIT:
So the answer is no, right now there is no way to (easily) say if matlab is busy doing something other than a command line job.
You should be able to modify the status bar message of the main MATLAB window using the submission statusbar from Yair Altman on the MathWorks File Exchange. He discusses how it works in a post on his blog "Undocumented Matlab".
With this utility, you should be able to put up a "Busy..." message even when MATLAB doesn't do it automatically. Your code for the "Click me" button callback would probably look something like this:
...
statusbar(0, 'Busy...'); %# Set the status message
test; %# Run your function/script
statusbar(0, ''); %# Clear the status message
...
You could add a static text on the GUI itself and set its text to 'Busy'/'Idle' before/after your calculations are done, if making the GUI more user-friendly is the concern.
Probably what you are looking for:
Enter any arbritary code into the command line.
e.g. somthing like
asdfasdfasdfasdf
If the GUI routine is still running, then it will display busy, until the GUi function has ended. Only then it can start to execute asdfasdfasdfasdf.
If the Gui is already finished, then it will execute asdfasdfasdfasdf instantaneously and display the according error message.
Earlier all Matlabs displayed also the busy message, when beeing executing a Gui-started function. Since 2012 this seems no longer to be the case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With