[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

spinbox bombs

Bill Welch

1/19/2006 9:18:00 PM

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

4 Answers

gmurray

1/20/2006 12:51:00 AM

0

> 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

Bill Welch

1/20/2006 11:38:00 AM

0

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

1/20/2006 11:40:00 AM

0

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

gmurray

1/20/2006 9:20:00 PM

0

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