Progress Bars via Tk

Put up a Tk progress bar widget.

tkProgressBar(title = "R progress bar", label = "", min = 0, max = 1, initial = 0, width = 300)
getTkProgressBar(pb) setTkProgressBar(pb, value, title = NULL, label = NULL) "close"(con, ...)
title, label
character strings, giving the window title and the label on the dialog box respectively.
min, max
(finite) numeric values for the extremes of the progress bar.
initial, value
initial or new value for the progress bar.
the width of the progress bar in pixels: the dialog box will be 40 pixels wider (plus frame).
pb, con
an object of class "tkProgressBar".
for consistency with the generic.

tkProgressBar will display a widget containing a label and progress bar.

setTkProgessBar will update the value and for non-NULL values, the title and label (provided there was one when the widget was created). Missing (NA) and out-of-range values of value will be (silently) ignored.

The progress bar should be closed when finished with.

This will use the ttk::progressbar widget for Tk version 8.5 or later, otherwise R's copy of BWidget's progressbar.


For tkProgressBar an object of class "tkProgressBar".For getTkProgressBar and setTkProgressBar, a length-one numeric vector giving the previous value (invisibly for setTkProgressBar).

See Also

txtProgressBar windows

winProgressBar for a version using Windows native controls (which this also does for Tk >= 8.5).

  • tkProgressBar
  • getTkProgressBar
  • setTkProgressBar
  • close.tkProgressBar
Documentation reproduced from package tcltk, version 3.1.0, License: Part of R 3.1.0

Community examples

Looks like there are no examples yet.