Ruby/TK equivalent to Perl/TK "Scrolled" method

A

Alex DeCaria

Perl/Tk contains a "Scrolled" method which is a shortcut method for
creating a widget with a scrollbar (Learning Perl/TK, by Walsh, pg. 126)
without creating a widget and a scrollbar separately. Does Ruby/TK have
a similar method, or do I have to create the widget and scrollbar
separately?

Thanks!
 
G

Gregor Kopp

Alex said:
Perl/Tk contains a "Scrolled" method which is a shortcut method for
creating a widget with a scrollbar (Learning Perl/TK, by Walsh, pg. 126)
without creating a widget and a scrollbar separately. Does Ruby/TK have
a similar method, or do I have to create the widget and scrollbar
separately?

Thanks!

If it helps, you can use scrollbars this way:

# example how to add scrollbars to items
require 'tk'
root = TkRoot.new
list = TkListbox.new(root, 'selectmode'=>'single')
list.yscrollbar(TkScrollbar.new(root).pack('side'=>'left', 'fill'=>'y'))
Tk.mainloop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top