K
Kevin
I am would like to start making my programs more responsive by
introducing threading.
My programs perform reasonable size db queries and builds large
treeviews etc. I know how to create thread and set them off etc, which
leaves the GUI nice and responsive for the user.
However, this also means that they might do something that affects the
thread, like clearing the treeview, or trying to start another query
while that is running. I would say that to start off I would like to
stop the user doing ANYTHING while, say, a db query was running.
What is the best way to achieve this? One way would be to have a
global variable called boolBUSY, then every time the user tries to do
something it first checks this variable before continuing. The only
think about this way is that you have to put in in every event handler
which seems a bit clunky. Or, similarly, you could check that the
cursor is not an hourglass but this gives the same problem.
Is there a way to ignore certain user input (keyboard, mouse click
etc)?
The Eclipse Java IDE brings up a little dialog box that says something
along the lines of 'System busy, cannot interupt', which seems
reasonable.
Any pointers would be greatfully received.
Thanks
Kevin
introducing threading.
My programs perform reasonable size db queries and builds large
treeviews etc. I know how to create thread and set them off etc, which
leaves the GUI nice and responsive for the user.
However, this also means that they might do something that affects the
thread, like clearing the treeview, or trying to start another query
while that is running. I would say that to start off I would like to
stop the user doing ANYTHING while, say, a db query was running.
What is the best way to achieve this? One way would be to have a
global variable called boolBUSY, then every time the user tries to do
something it first checks this variable before continuing. The only
think about this way is that you have to put in in every event handler
which seems a bit clunky. Or, similarly, you could check that the
cursor is not an hourglass but this gives the same problem.
Is there a way to ignore certain user input (keyboard, mouse click
etc)?
The Eclipse Java IDE brings up a little dialog box that says something
along the lines of 'System busy, cannot interupt', which seems
reasonable.
Any pointers would be greatfully received.
Thanks
Kevin