require 'tk' scr = TkScrollbar.new.pack('fill'=>'y', 'side'=>'right') text = TkText.new.pack('side'=>'right') text.yscrollbar( scr ) Tk.mainloop