title: Display a progress bar in an existing tcltk window with R
body: <p>My  program contains a main window in which I would like to display a progress bar. I use tcltk and R.</p>
  
  <p>The following code shows how to display a progress bar in a new popped-up window, that is not what I want to do : I want it to be inside a window I precedently created.</p>
  
  <pre><code>pb &lt;- tkProgressBar("test progress bar", "Some information in %",0, 100, 50)
  Sys.sleep(0.5)
  u &lt;- c(0, sort(runif(20, 0, 100)), 100)
  for(i in u) {
      Sys.sleep(0.1)
      info &lt;- sprintf("%d%% done", round(i))
      setTkProgressBar(pb, i, sprintf("test (%s)", info), info)
  }
  Sys.sleep(5)
  close(pb)
  </code></pre>
  
  <p>I've no idea how to insert it in my window.</p>
  
  <p>Thank you</p>