Friday, 27 September 2013

RGTK2 block user input while processing

RGTK2 block user input while processing

I have written a GUI in R with RGTK2 and Tcltk that does a lot of fairly
heavy calculations and aggregations on big data sets.
I would like to find a way to stop the user interface from accepting user
inputs while it is processing a large data set, and ideally, change the
interface color, popup a dialogue, or change the mouse pointer to an
hourglass/spinner to indicate to users that the application is active.
The implementation that I want would look something like:
gSignalConnect(bigRedButton,"clicked",
f=function(widget)
{
something$start() # object with method that blocks further user input
# and pops up loading bar or "Processing" dialogue
# (or possibly spins the mouse)
# Code that does a very big set of calculations
something$stop() # unblocks user inputs and removes visual impedance
}
)
I have tried using gtkDialogue to solve the problem, but this seems to
stop execution of the whole program until one closes the dialogue, which
rather defeats the purpose.
Any help would be greatly appreciated.

No comments:

Post a Comment