tkProgressBar             package:tcltk             R Documentation

_P_r_o_g_r_e_s_s _B_a_r_s _v_i_a _T_k

_D_e_s_c_r_i_p_t_i_o_n:

     Put up a Tk progress bar widget.

_U_s_a_g_e:

     tkProgressBar(title = "R progress bar", label = "",
                   min = 0, max = 1, initial = 0, width = 300)

     getTkProgressBar(pb)
     setTkProgressBar(pb, value, title = NULL, label = NULL)
     ## S3 method for class 'tkProgressBar':
     close(con, ...)

_A_r_g_u_m_e_n_t_s:

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.

   width: 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.

_D_e_t_a_i_l_s:

     '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 'close'd 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'.

_V_a_l_u_e:

     For 'tkProgressBar' an object of class '"tkProgressBar"'.

     For 'getTkProgressBar' and 'setTkProgressBar', a length-one
     numeric vector giving the previous value (invisibly for
     'setTkProgressBar').

_S_e_e _A_l_s_o:

     'txtProgressBar'

_E_x_a_m_p_l_e_s:

     pb <- tkProgressBar("test progress bar", "Some information in %",
                         0, 100, 50)
     Sys.sleep(0.5)
     u <- c(0, sort(runif(20, 0 ,100)), 100)
     for(i in u) {
         Sys.sleep(0.1)
         info <- sprintf("%d%% done", round(i))
         setTkProgressBar(pb, i, sprintf("test (%s)", info), info)
     }
     Sys.sleep(5)
     close(pb)

