spinbox bombs

Discussion in 'Ruby' started by Bill Welch, Jan 19, 2006.

  1. Bill Welch

    Bill Welch Guest

    I can't get spinbox to work and get the following:

    c:/ruby/lib/ruby/1.8/tk.rb:1496:in `_invoke_without_enc': invalid
    command name `spinbox' (NameError)

    I recently started using Ruby and am using 1.8.2
     
    Bill Welch, Jan 19, 2006
    #1
    1. Advertising

  2. > I recently started using Ruby and am using 1.8.2

    (Using ruby 1.8.4)
    There are examples in the ruby source code distribution that can be
    invoked by:
    ruby-1.8.4/ext/tk/sample/demos-en/widget
    Then look for the spinboxes in the window that appears.

    # -code begin
    require 'tk'

    berry = ['strawberry','blueberry','raspberry','huckleberry','mulberry']

    r = TkRoot.new{
    title "simple spin"
    }
    f = TkFrame.new(r)
    s = TkSpinbox.new(f,
    :values=>berry, :width=>12)
    f.pack
    s.pack('padx'=>30)

    Tk.mainloop
    # -code end

    regards,
    Gerald
     
    Gerald Murray, Jan 20, 2006
    #2
    1. Advertising

  3. Bill Welch

    Bill Welch Guest

    Tnx for the info. It is not that I don't know how to call the spinbox,
    but that the internals of Tk are bombing. Even the Tk Widget demo won't
    run spinbox and gets the same error. I've been digging around in tk.rb,
    spinbox.rb, and other pieces of Tk trying to understand what is wrong.

    Bottom line - does it work for you? What version of Ruby and what
    version of Tk are you running?

    TIA
    Bill
     
    Bill Welch, Jan 20, 2006
    #3
  4. Bill Welch

    Bill Welch Guest

    Gerald,

    Ran your example and here is what I get:

    >rubyw "ExSpinbox1.rbw"

    c:/ruby/lib/ruby/1.8/tk.rb:1496:in `_invoke_without_enc': invalid
    command name `spinbox' (NameError)
    from c:/ruby/lib/ruby/1.8/tk.rb:1496:in `_ip_invoke_core'
    from c:/ruby/lib/ruby/1.8/tk.rb:1532:in `_tk_call_core'
    from c:/ruby/lib/ruby/1.8/tk.rb:1560:in `tk_call_without_enc'
    from c:/ruby/lib/ruby/1.8/tk.rb:3416:in `create_self'
    from c:/ruby/lib/ruby/1.8/tk/validation.rb:63:in `create_self'
    from c:/ruby/lib/ruby/1.8/tk.rb:3399:in `initialize'
    from ExSpinbox1.rbw:15:in `new'
    from ExSpinbox1.rbw:15
    >Exit code: 1


    Bill
     
    Bill Welch, Jan 20, 2006
    #4
  5. The program posted runs standalone using
    tcl8.4, tk8.4, ruby-1.8.4, all compiled from source.
    distrib ubuntu hoary
    Linux 2.6.14 i686 GNU/Linux

    I see your other thread, in which you show how you did get
    spinboxes to work.

    regards,
    Gerald
     
    Gerald Murray, Jan 20, 2006
    #5
    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. John
    Replies:
    3
    Views:
    374
    John Saunders
    Jul 21, 2004
  2. Tony Eva
    Replies:
    1
    Views:
    485
    Jeff Epler
    Nov 9, 2003
  3. Askari

    Spinbox (Tkinter module)

    Askari, Apr 4, 2004, in forum: Python
    Replies:
    0
    Views:
    661
    Askari
    Apr 4, 2004
  4. Bill Welch

    Spinbox - TCL/Tk 8.4 - Ruby 1.8.2

    Bill Welch, Jan 20, 2006, in forum: Ruby
    Replies:
    0
    Views:
    114
    Bill Welch
    Jan 20, 2006
  5. Mark Summerfield

    ttk.Spinbox missing?

    Mark Summerfield, Jun 6, 2012, in forum: Python
    Replies:
    0
    Views:
    308
    Mark Summerfield
    Jun 6, 2012
Loading...

Share This Page