E
email55555 email55555
It seems to me that there is a bug on TkBindTag.new_by_name.
Here is an example:
# The action on new_by_name has no effect ?! bug ?
require 'tk'
TkBindTag.new_by_name('My_BindTag', 'Button') {|e| puts 'OK'}
TkLabel.newtext=>:Test).pack.bindtags = ['My_BandTag']
Tk.mainloop
However, this works:
require 'tk'
b = TkBindTag.new_by_name('My_BindTag')
b.bind('Button') {|e| puts 'OK'}
TkLabel.newtext=>:Test).pack.bindtags = ['My_BandTag']
Tk.mainloop
By looking on the source code of TkBindTag, it seems on the new_by_name:
BTagID_TBL.delete @id ==> also delete the old action
the new one just has its name but no action associate to it.
That is maybe why the new_by_name action has no effect.
This seems a bug ?
Thanks.
Here is an example:
# The action on new_by_name has no effect ?! bug ?
require 'tk'
TkBindTag.new_by_name('My_BindTag', 'Button') {|e| puts 'OK'}
TkLabel.newtext=>:Test).pack.bindtags = ['My_BandTag']
Tk.mainloop
However, this works:
require 'tk'
b = TkBindTag.new_by_name('My_BindTag')
b.bind('Button') {|e| puts 'OK'}
TkLabel.newtext=>:Test).pack.bindtags = ['My_BandTag']
Tk.mainloop
By looking on the source code of TkBindTag, it seems on the new_by_name:
BTagID_TBL.delete @id ==> also delete the old action
the new one just has its name but no action associate to it.
That is maybe why the new_by_name action has no effect.
This seems a bug ?
Thanks.