spinbox bombs

B

Bill Welch

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
 
G

Gerald Murray

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
 
B

Bill Welch

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
 
B

Bill Welch

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
 
G

Gerald Murray

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
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top