Closed mtasaka closed 4 years ago
These warnings will not be displayed by default in Ruby 2.7.2. If you enable verbose warnings, then tk will emit a bunch of warnings, as it is not verbose warning free. However, it should be simple to fix this case.
If you enable verbose warnings, then tk will emit a bunch of warnings, as it is not verbose warning free. However, it should be simple to fix this case.
Thing is I have adopted a habit of using verbose -w all the time. I just like it when ruby does not warn me. :)
The tk gem could need an overhaul; there are tons of things such as
gems/tk-0.3.0/lib/tk.rb:3655: warning: instance variable @mode not initialized
gems/tk-0.3.0/lib/tk.rb:2855: warning: instance variable @encoding not initialized
I mean, these are all just warnings so they can be ignored or people can toggle-re-instate $VERBOSE, which I use anyway - but if possible, some heroic hacker could try to fix these all. I had a look at the code but the code is quite scary; it seems to be fairly old ruby code. Though I also learned something new, the initialize alias trick.
Can you try #24 and see if it fixes the warnings for you?
With
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
, released ruby-tk 0.3.0 emits warnings when$ cd sample/demos-en
$ ruby ./widget
15. The simple Themed Tk widgets (require Tile/Ttk extension)
Then wanings appear on cosole: