F
Ferenc Engard
Hello,
Take the following example:
--------------------------------------
require 'tk.rb'
trap 0, proc { sleep 0.1 }
e=TkEntry.new()
e.validatecommand([proc{|w,t| valid(w,t)},'%W %V'])
e.validate('focusout')
e2=TkEntry.new()
e.pack
e2.pack
def valid(w,t)
puts "valid!"
raise "exception"
end
Tk.mainloop
--------------------------------------
(The trap cmd still needed with the latest debian unstable ruby -- ruby
1.8.0 (2003-10-05) [i386-linux]...) :-(
If I focus e, then take focus away, it prints "valid!" and raises an
exception, as I expect. BUT, after that, the valid() method never runs
on subsequent focus loses!
What is the problem?
Ferenc
Take the following example:
--------------------------------------
require 'tk.rb'
trap 0, proc { sleep 0.1 }
e=TkEntry.new()
e.validatecommand([proc{|w,t| valid(w,t)},'%W %V'])
e.validate('focusout')
e2=TkEntry.new()
e.pack
e2.pack
def valid(w,t)
puts "valid!"
raise "exception"
end
Tk.mainloop
--------------------------------------
(The trap cmd still needed with the latest debian unstable ruby -- ruby
1.8.0 (2003-10-05) [i386-linux]...) :-(
If I focus e, then take focus away, it prints "valid!" and raises an
exception, as I expect. BUT, after that, the valid() method never runs
on subsequent focus loses!
What is the problem?
Ferenc