inst/examples/GCancellable.R

## Make sure we don't do any unnecessary work if already cancelled
if (cancellable$setErrorIfCancelled())
  return()
## Set up all the data needed to be able to
## handle cancellation of the operation
my_data <- myData(...)

id <- 0
if (!is.null(cancellable))
  id <- cancellable$connect(cancelled_handler, data, NULL)

## cancellable operation here...

cancellable$disconnect(id)

Try the RGtk2 package in your browser

Any scripts or data that you put into this service are public.

RGtk2 documentation built on May 30, 2017, 5:53 a.m.