undefined method `yscrollcommand' for nil:NilClass (NoMethodError)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ruby1.9 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: ruby1.9
Ubuntu release: Karmic
Package version: 1.9.0.5-1ubuntu
I expected the Ruby/Tk test script at the end to run the same as under Ruby1.8 and Ruby1.9.1. Instead, it came back with the message:
ruby1.9 ./crash19a.rb
./crash19a.rb:12:in `block (3 levels) in <main>': undefined method `yscrollcommand' for nil:NilClass (NoMethodError)
from ./crash19a.rb:9:in `new'
from ./crash19a.rb:9:in `block (2 levels) in <main>'
from /usr/lib/
from /usr/lib/
from ./crash19a.rb:8:in `block in <main>'
from ./crash19a.rb:7:in `new'
from ./crash19a.rb:7:in `<main>'
This is the test script:
#!/usr/bin/ruby
require 'tk'
root = TkRoot.new()
t = TkToplevel.new( root ) { |tl|
TkText.new( tl ) { |tx|
TkScrollbar
pack( 'side' => 'right', 'fill' => 'y' )
command proc{ |*args| t.yview(*args) }
tx.
}
pack( 'expand'=>'yes', 'fill'=>'both' )
insert( '0.0', "This window is a text widget." )
}
TkButton.new( tl ) {
text 'Leave'
command proc{ tl.withdraw; root.focus }
pack
}
withdraw
}
TkButton.new( root ) {
text 'Popup'
command proc{ t.deiconify }
pack
}
TkButton.new( root ) {
text 'Quit'
command proc{ root.destroy }
pack
}
Tk.mainloop