I'm tryng to add a tooltip to widgets. but, I get an error when loading the library.
C:/usr/Ruby/lib/ruby/gems/4.0.0/gems/tk-0.6.0/lib/tkextlib/tcllib/tooltip.rb:38:in '<module:Tooltip>': uninitialized constant Tk::Tcllib::Tooltip::WidgetClassNames (NameError)
WidgetClassNames[WidgetClassName] ||= self
^^^^^^^^^^^^^^^^
from C:/usr/Ruby/lib/ruby/gems/4.0.0/gems/tk-0.6.0/lib/tkextlib/tcllib/tooltip.rb:34:in '<top (required)>'
from tootip_test.rb:6:in 'Kernel#require'
from tootip_test.rb:6:in '<main>'
'tooltip_test.rb' is below
require 'tk'
require 'tkextlib/tcllib/tooltip'
root = TkRoot.new { title "Tooltip Test" }
button = TkButton.new(root) {
text "Hover me"
pack('padx'=>20, 'pady'=>20)
}
Tk::Tcllib::Tooltip.register(button, "Tip help here.")
Tk.mainloop
' WidgetClassNames' in 'tooltip.rb'
|
module Tk::Tcllib::Tooltip |
|
extend TkCore |
|
|
|
WidgetClassName = 'Tooltip'.freeze |
|
WidgetClassNames[WidgetClassName] ||= self |
|
|
|
def self.database_classname |
|
self::WidgetClassName |
|
end |
|
def self.database_class |
|
WidgetClassNames[self::WidgetClassName] |
|
end |
the 'WidgetClassNames' seems to be a constat of 'TkCore' ?
Experimentally. I modified ' WidgetClassNames' to 'TkCore::'WidgetClassNames' , and It seems to be going well.
I'm tryng to add a tooltip to widgets. but, I get an error when loading the library.
'tooltip_test.rb' is below
' WidgetClassNames' in 'tooltip.rb'
tk/lib/tkextlib/tcllib/tooltip.rb
Lines 34 to 45 in 3060cde
the 'WidgetClassNames' seems to be a constat of 'TkCore' ?
Experimentally. I modified ' WidgetClassNames' to 'TkCore::'WidgetClassNames' , and It seems to be going well.