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

Discussion in 'Ruby' started by Alex DeCaria, Feb 28, 2007.

  1. Alex DeCaria

    Alex DeCaria Guest

    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!

    --
    Posted via http://www.ruby-forum.com/.
     
    Alex DeCaria, Feb 28, 2007
    #1
    1. Advertisements

  2. Alex DeCaria

    Gregor Kopp Guest

    Alex DeCaria schrieb:
    > 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
     
    Gregor Kopp, Mar 1, 2007
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Timo
    Replies:
    4
    Views:
    613
    clintonG
    May 8, 2004
  2. Simon Andrews
    Replies:
    2
    Views:
    940
    Knute Johnson
    Dec 7, 2006
  3. Replies:
    0
    Views:
    439
  4. Astan Chee
    Replies:
    1
    Views:
    523
  5. Googy
    Replies:
    5
    Views:
    350
    James Edward Gray II
    Sep 13, 2006
  6. anil kandimalla
    Replies:
    2
    Views:
    256
    Lex Williams
    Sep 10, 2008
  7. Chris
    Replies:
    1
    Views:
    240
    Chris
    Feb 27, 2009
  8. C. Dagnon
    Replies:
    1
    Views:
    156
    C. Dagnon
    Feb 27, 2009
Loading...