title: Resizeable Tk windows done right
body: <p>There is something wrong with the way I assemble my Tk windows (with R tcltk and tcltk2, under Win XP)</p>
  
  <pre><code>library(tcltk)
  library(tcltk2)
  
  expandTk &lt;- function() {
    root  &lt;- tktoplevel()
    # textbox with scroll bars
    textbox &lt;- tk2frame(root)
    scr &lt;- tkscrollbar(textbox, repeatinterval=5, command=function(...) tkyview(txt,...))
    txt &lt;- tktext(textbox, bg="white", font="courier", wrap="word", yscrollcommand=function(...)tkset(scr,...))
    tkpack(txt, side="left", fill="both", expand=TRUE)
    tkpack(scr, side="right", fill="y")
    tkmark.set(txt,"insert","0.0")
    tkpack(textbox, fill="both", expand=TRUE)
    # status bar and size grip
    statusText &lt;- tclVar("")
    f &lt;- tk2frame(root, relief="sunken")
    l &lt;- tk2label(f, textvariable=statusText)
    tkpack(l, side="left", pady=2, padx=5, expand=0, fill="x")
    tkpack(f, side="left", expand=1, fill="x", anchor="s")
    sg &lt;- ttksizegrip(root)
    tkpack(sg, side="left", expand=0, anchor="se")
  }
  </code></pre>
  
  <p>The window looks fine, but as soon as I resize it (ie make it smaller), the scrollbar and the statusbar disappears. I am quite sure that this is a user error, I have seen other Tk apps which resize properly, but I can not figure out which option I should use...</p>
  
  <p>Any hint appreciated,
  Karsten</p>