Trying to get back into Tk

After a hiatus of many years, I'm trying to get back into Tk via Ruby. Unfortunately, my first attempt--a simple text box with attached scroll bar--doesn't work very well. The scroll bar doesn't show up, and the text box only gets so large; past that point, enlarging the window doesn't enlarge the text box. I've copied in my code, and would greatly appreciate it if someone could tell me where I'm going wrong. It's been a long time since using Tk, and I've never used it with Ruby.

Thanks,
Ken

require 'tk'

ROOT = TkRoot.new {title 'WIN'}
FRAME = TkFrame.new(ROOT)

TEXT = TkText.new(FRAME) {
     pack 'side' => 'left', 'fill' => 'both', 'expand' => 'true'
}
YSCROLL = TkScrollbar.new(FRAME) do command {
      >first, last| TEXT.yview first, last
     pack 'side' => 'right', 'fill' => 'y'
}
end
TEXT.yscrollcommand {|first, last| YSCROLL.set(first, last) }
FRAME.pack
Tk.mainloop

Message-ID: <CE1DD84B-B1CD-45A4-9632-D8E414B7587C@sbcglobal.net>

YSCROLL = TkScrollbar.new(FRAME) do command {
      >first, last| TEXT.yview first, last
     pack 'side' => 'right', 'fill' => 'y'

       ^^^ Here is the reason of your trouble.

}
end

The 'pack' method call is written in the callback of the scrollbar.
You have to write it at external of the callback.
For example,

···

From: Kenneth McDonald <kenneth.m.mcdonald@sbcglobal.net>
Subject: Trying to get back into Tk
Date: Wed, 3 Dec 2008 05:42:41 +0900
------------------------------------
YSCROLL = TkScrollbar.new(FRAME) do
  command {|first, last| TEXT.yview first, last}
  pack 'side' => 'right', 'fill' => 'y'
end
------------------------------------
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)