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. Advertising

  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. Advertising

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:
    474
    clintonG
    May 8, 2004
  2. Simon Andrews
    Replies:
    2
    Views:
    730
    Knute Johnson
    Dec 7, 2006
  3. Replies:
    0
    Views:
    351
  4. Chris
    Replies:
    1
    Views:
    155
    Chris
    Feb 27, 2009
  5. C. Dagnon
    Replies:
    1
    Views:
    93
    C. Dagnon
    Feb 27, 2009
Loading...

Share This Page