Giter Club home page Giter Club logo

tk's People

Contributors

aardvark179 avatar akr avatar amatsuda avatar andyobtiva avatar arbox avatar ayumin avatar ckrailo avatar dashurai avatar dependabot[bot] avatar dogatana avatar drbrain avatar duerst avatar eban avatar graywolf avatar h-nagai avatar haileys avatar hsbt avatar jeremyevans avatar k-tsj avatar knu avatar ko1 avatar kojix2 avatar larskanis avatar nagachika avatar nobu avatar nurse avatar olleolleolle avatar unak avatar yugui avatar znz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tk's Issues

tk decreases load speed of others gems loading after it

If tk is loaded firstly, gems after it would take a long time to load. This becomes extreme with gem rubyXL. Here is the result:

############## first require tk, then rubyXL
t0 = Time.now
require 'tk'
puts Time.now - t0 # 1.35 secs
t0 = Time.now
require 'rubyXL'
puts Time.now - t0 # 58.6 secs

############## first require rubyXL, then tk
t0 = Time.now
require 'rubyXL'
puts Time.now - t0 # 0.28 secs
t0 = Time.now
require 'tk'
puts Time.now - t0 # 2.8 secs

my app use tk as gui. When I use ruby 2.3.1, I do not see this issue. After I upgrade to ruby 2.7.2, the issue shows up. And now I downgrade to ruby 2.6.6, the issue is still there.

Tk::Text listening to a tag covering 1.0 to end stops working after clearing all text (on Mac)

In light of the solution to #36, I wrote code that monitored key presses upon moving around a Tk::Text widget with the arrow keys. It basically registers a listener to <KeyPress> event on a pre-added tag that covers a range of index 1.0 to end.

Here is a code example of this:

require 'tk'

@root = Tk::Root.new

@text = Tk::Text.new(@root).grid
@text.value = "Some giberish repeated many times\n"*20
@text.tag_add('all', '1.0', 'end')
@text.tag_bind('all', 'KeyPress', ->(event) {puts 'key press', event.inspect})

@root.mainloop

You can navigate around the Tk::Text widget using the arrow keys with no problem. It always fires the <KeyPress> listener anywhere in the 1.0 to end range, printing the event information.

Trouble starts once I clear all the text by highlighting with CMD+A and then hitting DELETE. Afterwards, when I type new text and then move the arrow keys around, no firing of the <KeyPress> event happens anymore.

The plot thickens however. If I insert enough new lines, it sometimes starts firing again, albeit temporarily, and then it stops again.

Either way, the functionality seems broken. It is probably broken in ActiveTcl, not in the Ruby code, but I thought I'd report here just in case there is an issue in the Ruby code.

p.s. I am using ActiveTcl-8.6.9.8609.2-macosx10.9-x86_64-93b04018

Can't install tk, something about tcltklib

So my profs doc basically just says "Execute 'gem install tk'", but trying that results in an error that should probably help me install something I'm missing, but I'm not sure if I just lack a certain config option or something?
I basically just installed Ruby via RubyInstaller2, including msys2 with ridk install 1 3 afterwards.
This is the install output:

PS C:\Windows\system32> gem install tk
Temporarily enhancing PATH for MSYS/MINGW...
Installing required msys2 packages: mingw-w64-x86_64-tk
pacman failed with the following output:
resolving dependencies...
looking for conflicting packages...

Packages (2) mingw-w64-x86_64-tcl-8.6.10-1  mingw-w64-x86_64-tk-8.6.10-2

Total Download Size:    4.95 MiB
Total Installed Size:  16.16 MiB

:: Proceed with installation? [Y/n]
:: Retrieving packages...
Building native extensions. This could take a while...
ERROR:  Error installing tk:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/tk-0.3.0/ext/tk
C:/Ruby27-x64/bin/ruby.exe -I C:/Ruby27-x64/lib/ruby/2.7.0 -r ./siteconf20201104-16848-1gsper9.rb extconf.rb
check functions.checking for ruby_native_thread_p() in ruby.h... yes
checking for rb_errinfo() in ruby.h... yes
checking for rb_hash_lookup() in ruby.h... yes
checking for rb_proc_new() in ruby.h... yes
checking for rb_sourcefile() in ruby.h... yes
checking for rb_thread_alive_p() in ruby.h... no
checking for rb_thread_check_trap_pending() in ruby.h... yes
checking for ruby_enc_find_basename() in ruby.h... yes
Use ActiveTcl libraries (if available).
Search tclConfig.sh and tkConfig.sh.
Fail to find [tclConfig.sh, tkConfig.sh]
Search tcl.h
checking for tcl.h... no
Search tk.h
checking for tk.h... no
Search Tcl library....Search Tk library...............Search Tk library...............*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby27-x64/bin/$(RUBY_BASE_NAME)
        --enable-shared
        --disable-shared
        --with-tk-old-extconf
        --without-tk-old-extconf
        --with-tk-old-extconf
        --without-tk-old-extconf
        --with-ActiveTcl
        --without-ActiveTcl
        --with-tk-shlib-search-path
        --without-tk-shlib-search-path
        --with-tcltkversion
        --without-tcltkversion
        --with-tcl-build-dir
        --without-tcl-build-dir
        --with-tk-build-dir
        --without-tk-build-dir
        --with-tcl-config
        --without-tcl-config
        --with-tk-config
        --without-tk-config
        --with-tclConfig-dir
        --without-tclConfig-dir
        --with-tkConfig-dir
        --without-tkConfig-dir
        --with-tclConfig-file
        --without-tclConfig-file
        --with-tkConfig-file
        --without-tkConfig-file
        --with-tcllib
        --without-tcllib
        --with-tklib
        --without-tklib
        --with-tcl-dir
        --without-tcl-dir
        --with-tk-dir
        --without-tk-dir
        --with-tcl-include
        --without-tcl-include
        --with-tk-include
        --without-tk-include
        --with-tcl-lib
        --without-tcl-lib
        --with-tk-lib
        --without-tk-lib
        --with-tcltk-framework
        --without-tcltk-framework
        --with-tcl-framework-dir
        --without-tcl-framework-dir
        --with-tk-framework-dir
        --without-tk-framework-dir
        --with-tcl-framework-header
        --without-tcl-framework-header
        --with-tk-framework-header
        --without-tk-framework-header
        --with-X11
        --without-X11
        --with-X11-dir
        --without-X11-dir
        --with-X11-include
        --without-X11-include
        --with-X11-lib
        --without-X11-lib
        --enable-tcltk-stubs
        --disable-tcltk-stubs
        --enable-tcl-h-ver-check
        --disable-tcl-h-ver-check
        --enable-tk-h-ver-check
        --disable-tk-h-ver-check
        --enable-mac-tcltk-framework
        --disable-mac-tcltk-framework
        --enable-tcltk-framework
        --disable-tcltk-framework
        --enable-pthread
        --disable-pthread
        --enable-tcl-thread
        --disable-tcl-thread
        --enable-space-on-tk-libpath
        --disable-space-on-tk-libpath
        --with-tcl-build-dir
        --without-tcl-build-dir
        --with-tk-build-dir
        --without-tk-build-dir
        --with-tcltkversion
        --without-tcltkversion
        --with-ActiveTcl
        --without-ActiveTcl
        --enable-space-on-tk-libpath
        --disable-space-on-tk-libpath
        --enable-tcltk-stubs
        --disable-tcltk-stubs
        --with-tcltk-stubs
        --without-tcltk-stubs
        --with-tcl-dir
        --without-tcl-dir
        --with-tcl-include
        --without-tcl-include=${tcl-dir}/include
        --with-tcl-lib
        --without-tcl-lib=${tcl-dir}/lib
        --with-tk-dir
        --without-tk-dir
        --with-tk-include
        --without-tk-include=${tk-dir}/include
        --with-tk-lib
        --without-tk-lib=${tk-dir}/lib
        --with-tclConfig-file
        --without-tclConfig-file
        --with-tkConfig-file
        --without-tkConfig-file
        --with-tclConfig-dir
        --without-tclConfig-dir
        --with-tkConfig-dir
        --without-tkConfig-dir
        --with-tk-shlib-search-path
        --without-tk-shlib-search-path
        --with-tklib
        --without-tklib
        --with-tcllib
        --without-tcllib
        --with-X11
        --without-X11
        --enable-tcl-h-ver-check
        --disable-tcl-h-ver-check
        --enable-tk-h-ver-check
        --disable-tk-h-ver-check

Warning:: cannot find Tk library. tcltklib will not be compiled (tcltklib is disabled on your Ruby. That is, Ruby/Tk will not work). Please check configure options.

Can't find proper Tcl/Tk libraries. So, can't make tcltklib.so which is required by Ruby/Tk.
If you have Tcl/Tk libraries on your environment, you may be able to use them with configure options (see ext/tk/README.tcltklib).
At present, Tcl/Tk8.6 is not supported. Although you can try to use Tcl/Tk8.6 with configure options, it will not work correctly. I recommend you to use Tcl/Tk8.5 or 8.4.

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/Ruby27-x64/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/tk-0.3.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/tk-0.3.0 for inspection.
Results logged to C:/Ruby27-x64/lib/ruby/gems/2.7.0/extensions/x64-mingw32/2.7.0/tk-0.3.0/gem_make.out

The mentioned log file is huge, but I'll provide whatever information you need.

I'm a complete ruby beginner, I usually work with .NET or JS/TS. Let me know what information you need.

Two warnings in tk.rb

Warnings:

/root/.gem/gems/tk-0.5.0/lib/tk.rb:1321: warning: method redefined; discarding old to_s
/root/.gem/gems/tk-0.5.0/lib/tk.rb:36: warning: previous definition of to_s was here

Line 36 is:

https://github.com/ruby/tk/blob/master/lib/tk.rb#L36

Line 1321 is:

https://github.com/ruby/tk/blob/master/lib/tk.rb#L1321

Seem to be duplicates indeed, the same line there.

By the way, why is that class TclTkIp extended
twice in the .rb file? Would it not be easier to just use "class TclTkIp"
once, and do all modifications? That code base is a little odd.

extconf.rb ignores config_list.in

Hi, I installed ruby, ruby-dev, tk-dev from the MX Package Installer. If you want the versions I can give them, but as far as I can see it's not important for this issue. gem install tk could not find the libraries, etc. I followed the README.tcltklib and added the build variables to config_list.in, but this made no difference whatsoever, same errors as before.

A closer look at extconf.rb showed that it is not handling the mkmf methods correctly, so I patched extconf.rb, and per the readme I was able to do ruby extconf.rb followed by make and make install. But this did not give me gem. (By the way, even when I gave the correct tclConfig.sh and tkConfig.sh, it still ignored them even though the include and lib paths are in there. But I didn't investigate any further because I could use the include and lib build variables.)

Another gem install tk of course wiped out my ext/tk changes and produced the same errors as before. However, I finally succeeded by appending all my build variables to the command line. Again, I can show the variables, but the point is they are the same as what I put in config_list.in.

My patch to extconf.rb attached. I just started learning Ruby so it's quite possible my patch is not perfect, but I think is a step in the right direction.
extconf-rb.patch.txt

i can't install tk

~# gem install tk
Building native extensions. This could take a while...
ERROR: Error installing tk:
ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.7.0/gems/tk-0.2.0/ext/tk

/usr/bin/ruby2.7 -I /usr/local/lib/site_ruby/2.7.0 -r ./siteconf20201007-7660-1i5ky4m.rb extconf.rb
check functions.checking for ruby_native_thread_p() in ruby.h... yes
checking for rb_errinfo() in ruby.h... yes
checking for rb_safe_level() in ruby.h... yes
checking for rb_hash_lookup() in ruby.h... yes
checking for rb_proc_new() in ruby.h... yes
checking for rb_obj_untrust() in ruby.h... yes
checking for rb_obj_taint() in ruby.h... yes
checking for rb_set_safe_level_force() in ruby.h... yes
checking for rb_sourcefile() in ruby.h... yes
checking for rb_thread_alive_p() in ruby.h... no
checking for rb_thread_check_trap_pending() in ruby.h... yes
checking for ruby_enc_find_basename() in ruby.h... yes
check libraries.checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for dlopen() in -ldl... yes
checking for log() in -lm... yes
Use ActiveTcl libraries (if available).
Search tclConfig.sh and tkConfig.sh.
WARNING: found "/usr/lib/tclConfig.sh", but cannot find valid Tcl library for the tclConfig.sh. So, ignore it.

WARNING: found "/usr/lib/tkConfig.sh", but cannot find valid Tk library for the tkConfig.sh. So, ignore it.

WARNING: found "/lib/tclConfig.sh", but cannot find valid Tcl library for the tclConfig.sh. So, ignore it.

WARNING: found "/lib/tkConfig.sh", but cannot find valid Tk library for the tkConfig.sh. So, ignore it.

Fail to find [tclConfig.sh, tkConfig.sh]
Use X11 libraries (or use TK_XINCLUDES/TK_XLIBSW information on tkConfig.sh).
checking for XOpenDisplay() in -lX11... yes
Search tcl.h
checking for tcl.h... no
Search tk.h
checking for tk.h... no
Search Tcl library.........*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)2.7
--enable-shared
--with-tk-old-extconf
--without-tk-old-extconf
--with-tk-old-extconf
--without-tk-old-extconf
--with-ActiveTcl
--without-ActiveTcl
--with-tk-shlib-search-path
--without-tk-shlib-search-path
--with-tcltkversion
--without-tcltkversion
--with-tcl-build-dir
--without-tcl-build-dir
--with-tk-build-dir
--without-tk-build-dir
--with-tcl-config
--without-tcl-config
--with-tk-config
--without-tk-config
--with-tclConfig-dir
--without-tclConfig-dir
--with-tkConfig-dir
--without-tkConfig-dir
--with-tclConfig-file
--without-tclConfig-file
--with-tkConfig-file
--without-tkConfig-file
--with-tcllib
--without-tcllib
--with-tklib
--without-tklib
--with-tcl-dir
--without-tcl-dir
--with-tk-dir
--without-tk-dir
--with-tcl-include
--without-tcl-include
--with-tk-include
--without-tk-include
--with-tcl-lib
--without-tcl-lib
--with-tk-lib
--without-tk-lib
--with-tcltk-framework
--without-tcltk-framework
--with-tcl-framework-dir
--without-tcl-framework-dir
--with-tk-framework-dir
--without-tk-framework-dir
--with-tcl-framework-header
--without-tcl-framework-header
--with-tk-framework-header
--without-tk-framework-header
--with-X11
--without-X11
--with-X11-dir
--without-X11-dir
--with-X11-include
--without-X11-include
--with-X11-lib
--without-X11-lib
--enable-tcltk-stubs
--disable-tcltk-stubs
--enable-tcl-h-ver-check
--disable-tcl-h-ver-check
--enable-tk-h-ver-check
--disable-tk-h-ver-check
--enable-mac-tcltk-framework
--disable-mac-tcltk-framework
--enable-tcltk-framework
--disable-tcltk-framework
--enable-pthread
--disable-pthread
--enable-tcl-thread
--disable-tcl-thread
--enable-space-on-tk-libpath
--disable-space-on-tk-libpath
--with-nsl-dir
--without-nsl-dir
--with-nsl-include
--without-nsl-include=${nsl-dir}/include
--with-nsl-lib
--without-nsl-lib=${nsl-dir}/lib
--with-nsllib
--without-nsllib
--with-socket-dir
--without-socket-dir
--with-socket-include
--without-socket-include=${socket-dir}/include
--with-socket-lib
--without-socket-lib=${socket-dir}/lib
--with-socketlib
--without-socketlib
--with-dl-dir
--without-dl-dir
--with-dl-include
--without-dl-include=${dl-dir}/include
--with-dl-lib
--without-dl-lib=${dl-dir}/lib
--with-dllib
--without-dllib
--with-m-dir
--without-m-dir
--with-m-include
--without-m-include=${m-dir}/include
--with-m-lib
--without-m-lib=${m-dir}/lib
--with-mlib
--without-mlib
--with-tcl-build-dir
--without-tcl-build-dir
--with-tk-build-dir
--without-tk-build-dir
--with-tcltkversion
--without-tcltkversion
--with-ActiveTcl
--without-ActiveTcl
--enable-space-on-tk-libpath
--disable-space-on-tk-libpath
--enable-tcltk-stubs
--disable-tcltk-stubs
--with-tcltk-stubs
--without-tcltk-stubs
--with-tcl-dir
--without-tcl-dir
--with-tcl-include
--without-tcl-include=${tcl-dir}/include
--with-tcl-lib
--without-tcl-lib=${tcl-dir}/lib
--with-tk-dir
--without-tk-dir
--with-tk-include
--without-tk-include=${tk-dir}/include
--with-tk-lib
--without-tk-lib=${tk-dir}/lib
--with-tclConfig-file
--without-tclConfig-file
--with-tkConfig-file
--without-tkConfig-file
--with-tclConfig-dir
--without-tclConfig-dir
--with-tkConfig-dir
--without-tkConfig-dir
--with-tcl-framework-header
--without-tcl-framework-header
--with-tk-framework-header
--without-tk-framework-header
--with-tcl-framework-dir
--without-tcl-framework-dir
--with-tk-framework-dir
--without-tk-framework-dir
--with-tcltk-framework
--without-tcltk-framework
--enable-tcltk-framework
--disable-tcltk-framework
--with-tcltk-framework
--without-tcltk-framework
--enable-tcltk-framework
--disable-tcltk-framework
--enable-mac-tcltk-framework
--disable-mac-tcltk-framework
--with-tk-shlib-search-path
--without-tk-shlib-search-path
--with-tklib
--without-tklib
--with-tcllib
--without-tcllib
--with-X11
--without-X11
--with-X11-dir
--without-X11-dir
--with-X11-include
--without-X11-include=${X11-dir}/include
--with-X11-lib
--without-X11-lib=${X11-dir}/lib
--with-X11-lib
--without-X11-lib
--with-X11lib
--without-X11lib
--enable-tcl-h-ver-check
--disable-tcl-h-ver-check
--enable-tk-h-ver-check
--disable-tk-h-ver-check

Warning:: cannot find Tcl library. tcltklib will not be compiled (tcltklib is disabled on your Ruby. That is, Ruby/Tk will not work). Please check configure options.

Can't find proper Tcl/Tk libraries. So, can't make tcltklib.so which is required by Ruby/Tk.
If you have Tcl/Tk libraries on your environment, you may be able to use them with configure options (see ext/tk/README.tcltklib).
At present, Tcl/Tk8.6 is not supported. Although you can try to use Tcl/Tk8.6 with configure options, it will not work correctly. I recommend you to use Tcl/Tk8.5 or 8.4.

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/tk-0.2.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.7.0/gems/tk-0.2.0 for inspection.
Results logged to /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/tk-0.2.0/gem_make.out

How to track text widget insert mark change?

I noticed I could bind to the Tk::Text widget '<Modified>' and '<Selection>' events, but I could not find anything in the tutorial or documentation about how to track text widget insert mark (caret/cursor) changes.

The scenario I need it for is mimicking Word Processor behavior when the user moves the caret (typing cursor) using keyboard arrow or mouse keys and the toolbar formatting options on top (font/size/color/etc...) automatically reflect which style is applied to the current caret position (insert mark) (e.g. 'Bold', 'Helvetica', 'Size 20'). Once I have the insert mark position update event, I know where to get the formatting information from (by querying the tags). I just don't know how to register a listener or callback that would fire whenever the user moves the caret (typing cursor), aka insert mark.

Help would be greatly appreciated.

positionWindow(w)

In some of your samples positionWindow is called for TopLevel

demos-en/entry3.rb

in tk (0.2.0) this method is not available on my install

[6] pry(#Tk::Toplevel)> self.methods.map{|m| m.to_s}.select{|m| m =~ /^p/}
=> ["positionfrom",
"protocol",
"protocols",
"pack_in",
"pack_config",
"pack_configure",
"pack_info",
"pack_propagate",
"pack_slaves",
"pack",
"place_in",
"pack_forget",
"place",
"place_forget",
"place_configure",
"place_configinfo",
"place_config",
"place_slaves",
"place_info",
"path",
"pry",
"pretty_print",
"pretty_print_cycle",
"pretty_print_instance_variables",
"pretty_print_inspect",
"public_send",
"public_method",
"pretty_inspect",
"protected_methods",
"private_methods",
"public_methods"]

autoload.rb:455: warning: deprecated Object#=~ is called on Class; it always returns nil

With ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux] , released ruby-tk 0.3.0 emits warnings when

  • execute $ cd sample/demos-en
  • execute $ ruby ./widget
  • click: 15. The simple Themed Tk widgets (require Tile/Ttk extension)

Then wanings appear on cosole:

[tasaka1@localhost demos-en]$ ruby ./widget
/usr/share/gems/gems/tk-0.3.0/lib/tk/autoload.rb:455: warning: deprecated Object#=~ is called on Class; it always returns nil
/usr/share/gems/gems/tk-0.3.0/lib/tk/autoload.rb:455: warning: deprecated Object#=~ is called on Class; it always returns nil
/usr/share/gems/gems/tk-0.3.0/lib/tk/autoload.rb:455: warning: deprecated Object#=~ is called on Class; it always returns nil
/usr/share/gems/gems/tk-0.3.0/lib/tk/autoload.rb:455: warning: deprecated Object#=~ is called on Class; it always returns nil

Crash when DISPLAY is not set

$ DISPLAY= ruby -r tk -e ''
/usr/share/gems/gems/tk-0.2.0/lib/tk.rb:32:in `initialize': tcltklib: fail to Tk_Init(). couldn't connect to display "" (RuntimeError)
	from /usr/share/gems/gems/tk-0.2.0/lib/tk.rb:32:in `initialize'
	from /usr/share/gems/gems/tk-0.2.0/lib/tk.rb:1246:in `new'
	from /usr/share/gems/gems/tk-0.2.0/lib/tk.rb:1246:in `block in <module:TkCore>'
Tcl_AsyncDelete: async handler deleted by the wrong thread
Aborted (core dumped)
(gdb) bt
#0  0x00007ffff75c0818 in raise () from /lib64/libc.so.6
#1  0x00007ffff75c1f2a in abort () from /lib64/libc.so.6
#2  0x00007ffff543d83f in Tcl_PanicVA () from /lib64/libtcl8.6.so
#3  0x00007ffff543d8fc in Tcl_Panic () from /lib64/libtcl8.6.so
#4  0x00007ffff537088e in Tcl_AsyncDelete () from /lib64/libtcl8.6.so
#5  0x00007ffff5373ced in ?? () from /lib64/libtcl8.6.so
#6  0x00007ffff56efde8 in ip_free (p=0x7fffec0008f0) at tcltklib.c:5795
#7  0x00007ffff79d8fe1 in finalize_list () from /lib64/libruby.so.2.4
#8  0x00007ffff79e5750 in rb_gc_call_finalizer_at_exit () from /lib64/libruby.so.2.4
#9  0x00007ffff79d05ed in ruby_cleanup () from /lib64/libruby.so.2.4
#10 0x00007ffff79d0777 in ruby_run_node () from /lib64/libruby.so.2.4
#11 0x00000000004007fb in main (argc=<optimized out>, argv=<optimized out>) at main.c:36

Unknown command tk

When I execute $ gem 'tk'

It is giving me this error:

ERROR:  While executing gem ... (Gem::CommandLineError)
          Unknown command tk

Help, please?

inconsistent License

README.md says MIT License, but LICENSE.txt seems Ruby's License.
And the file BSDL mentioned in LICENSE.txt is missing.

Binding standard widget events does not work on text widget

Hi,

I tried binding '<KeyPress>', '<KeyRelease>', '<Button-1>' on TkText widget, but they did not result in any firing of changes.

text_test.rb Code example:

require 'tk'
require 'tkextlib/tile'

root = TkRoot.new {title "Text Test"}

text = TkText.new(root) {width 40; height 40}.grid(row: 0, column: 0, sticky: 'nsew')

text.bind('<KeyPress>', -> {puts 'KeyPress'})
text.bind('<KeyRelease>', -> {puts 'KeyRelease'})
text.bind('<Button-1>', -> {puts 'Button-1'})

Tk.mainloop

Help or clarification is appreciated.

bwidget example error

running bwidget example error:

TkPackage can't find package BWidget (RuntimeError)

Ruby crashes during `require 'tk'` on macOS 10.14.6 (Mojave)

When I install the tk gem with gem install tk and then type require 'tk' into irb, the program crashes with the error message below. This appears to be due to a new limitation of the macOS GUI layer.

I am able to work around this by installing ActiveTcl 8.6 and then reinstalling the gem.

I am using Ruby 2.7.0 built from sources using rbenv.

I also attempted to work around this using the tcl-tk package provided by HomeBrew. I was not successful but it is possible I did not correctly specify the version of Tcl/Tk to use.

If you would like, I am willing to submit a pull request that updates the README.md and lists ActiveTcl as a dependency for macOS.

Backtrace follows:

2021-04-27 12:24:31.874 ruby[22997:225436] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff2c10eacd __exceptionPreprocess + 256
	1   libobjc.A.dylib                     0x00007fff56812a17 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff2c128629 -[NSException raise] + 9
	3   AppKit                              0x00007fff296cd5ca -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 317
	4   AppKit                              0x00007fff296ca9f7 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1479
	5   AppKit                              0x00007fff296ca42a -[NSWindow initWithContentRect:styleMask:backing:defer:] + 45
	6   Tk                                  0x00007fff37ea6eae TkMacOSXMakeRealWindowExist + 749
	7   Tk                                  0x00007fff37ea6aea TkWmMapWindow + 56
	8   Tk                                  0x00007fff37e19c05 Tk_MapWindow + 155
	9   Tk                                  0x00007fff37e21dae TkInstallFrameMenu + 267
	10  Tcl                                 0x00007fff37db6e7c TclServiceIdle + 75
	11  Tcl                                 0x00007fff37d9e4b9 Tcl_DoOneEvent + 344
	12  tcltklib.bundle                     0x000000010d2d2f20 call_DoOneEvent_core + 16
	13  tcltklib.bundle                     0x000000010d2d29fb tk_funcall + 427
	14  libruby.2.7.dylib                   0x0000000109716843 rb_protect + 339
	15  tcltklib.bundle                     0x000000010d2cb592 lib_eventloop_main_core + 642
	16  libruby.2.7.dylib                   0x00000001097169c0 rb_ensure + 240
	17  tcltklib.bundle                     0x000000010d2ceacd lib_mainloop + 173
	18  tcltklib.bundle                     0x000000010d2d1dd4 ip_mainloop + 180
	19  libruby.2.7.dylib                   0x00000001098c97c0 vm_call_cfunc + 368
	20  libruby.2.7.dylib                   0x00000001098af69f vm_exec_core + 14527
	21  libruby.2.7.dylib                   0x00000001098c45dc rb_vm_exec + 2780
	22  libruby.2.7.dylib                   0x000000010987f35e thread_do_start + 910
	23  libruby.2.7.dylib                   0x000000010987ecad thread_start_func_2 + 557
	24  libruby.2.7.dylib                   0x000000010987e89c thread_start_func_1 + 268
	25  libsystem_pthread.dylib             0x00007fff581d52eb _pthread_body + 126
	26  libsystem_pthread.dylib             0x00007fff581d8249 _pthread_start + 66
	27  libsystem_pthread.dylib             0x00007fff581d440d thread_start + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
^CAbort trap: 6 (core dumped)

Tk.getMultipleSaveFile does not work on the Mac

The following code snippet works for all dialogs except the last one "Tk.getMultipleSaveFile"

require 'tk'

p Tk.getOpenFile
p Tk.getMultipleOpenFile
p Tk.getSaveFile
p Tk.getMultipleSaveFile

I get this error message:

/Users/andy/.rvm/gems/ruby-3.0.2@glimmer-dsl-tk/gems/tk-0.4.0/lib/tk.rb:2938:in `_invoke': bad option "-multiple": must be -defaultextension, -filetypes, -initialdir, -initialfile, -message, -parent, -title, -typevariable, -command, or -confirmoverwrite (RuntimeError)
	from /Users/andy/.rvm/gems/ruby-3.0.2@glimmer-dsl-tk/gems/tk-0.4.0/lib/tk.rb:2938:in `_invoke'
	from /Users/andy/.rvm/gems/ruby-3.0.2@glimmer-dsl-tk/gems/tk-0.4.0/lib/tk.rb:1983:in `_ip_invoke_core'
	from /Users/andy/.rvm/gems/ruby-3.0.2@glimmer-dsl-tk/gems/tk-0.4.0/lib/tk.rb:2016:in `_tk_call_core'
	from /Users/andy/.rvm/gems/ruby-3.0.2@glimmer-dsl-tk/gems/tk-0.4.0/lib/tk.rb:2039:in `tk_call'
	from /Users/andy/.rvm/gems/ruby-3.0.2@glimmer-dsl-tk/gems/tk-0.4.0/lib/tk.rb:1939:in `getMultipleSaveFile'
	from tmp/test_get_multiple_save_file.rb:6:in `<main>'

It seems like ActiveTcl-8.6.9.8609.2-macosx10.9-x86_64-93b04018.pkg has dropped support for Tk.getMultipleSaveFile

I'll try to confirm this behavior/issue on other platforms once I get a chance.

If it is true, I could perhaps contribute a Pull Request to remove that method (or provide a better error message on the Mac if it is a Mac-only issue)

Tcl_AsyncDelete: async handler deleted by the wrong thread

Program output:

C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/tk-0.2.0/lib/tk.rb:1332:in `run': killed
thread (ThreadError)
		from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/tk-0.2.0/lib/tk.rb:1332:in `
<module:TkCore>'
		from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/tk-0.2.0/lib/tk.rb:1153:in `
<top (required)>'
		from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55
:in `require'
		from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55
:in `require'
		from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jibril-0.0.1/bin/jibril:3:in
 `<top (required)>'
		from C:/Ruby24-x64/bin/jibril:23:in `load'
		from C:/Ruby24-x64/bin/jibril:23:in `<main>'
Tcl_AsyncDelete: async handler deleted by the wrong thread
C:/Ruby24-x64/bin/jibril: [BUG] Illegal instruction
ruby 2.4.2p198 (2017-09-14 revision 59899) [x64-mingw32]

-- Control frame information -----------------------------------------------
c:0001 p:0000 s:0003 E:000b30 (none) [FINISH]


-- C level backtrace information -------------------------------------------
C:\Windows\SYSTEM32\ntdll.dll(ZwWaitForSingleObject+0xa) [0x0000000076d1bd7a]
C:\Windows\system32\KERNELBASE.dll(WaitForSingleObjectEx+0x9c) [0x000007fefcad10
ac]
C:\Ruby24-x64\bin\x64-msvcrt-ruby240.dll(rb_print_backtrace+0x36) [0x0000000067b
029e6]
C:\Ruby24-x64\bin\x64-msvcrt-ruby240.dll(rb_vm_bugreport+0x65) [0x0000000067b02a
55]
C:\Ruby24-x64\bin\x64-msvcrt-ruby240.dll(rb_bug_context+0x69) [0x00000000679dce2
9]
C:\Ruby24-x64\bin\x64-msvcrt-ruby240.dll(rb_check_safe_obj+0x2f3) [0x0000000067a
98533]
 [0x000000000040240d]
C:\Windows\SYSTEM32\ntdll.dll(_C_specific_handler+0x9c) [0x0000000076ce7958]
C:\Windows\SYSTEM32\ntdll.dll(RtlDecodePointer+0xad) [0x0000000076cf812d]
C:\Windows\SYSTEM32\ntdll.dll(RtlUnwindEx+0xbbf) [0x0000000076ce855f]
C:\Windows\SYSTEM32\ntdll.dll(KiUserExceptionDispatcher+0x2e) [0x0000000076d1bcb
8]
C:\msys64\mingw64\bin\tcl86.dll(Tcl_PanicVA+0x127) [0x000000006d5ecfb7]
C:\msys64\mingw64\bin\tcl86.dll(Tcl_Panic+0x22) [0x000000006d5ecfe2]
C:\msys64\mingw64\bin\tcl86.dll(Tcl_AsyncDelete+0xc1) [0x000000006d510c91]
C:\msys64\mingw64\bin\tcl86.dll(Tcl_DeleteCommandFromToken+0x20f) [0x000000006d5
145bf]
 [0x0000000065d8248a]
C:\Ruby24-x64\bin\x64-msvcrt-ruby240.dll(rb_gc_enable+0x1f91) [0x00000000679ed1e
1]
C:\Ruby24-x64\bin\x64-msvcrt-ruby240.dll(rb_gc_call_finalizer_at_exit+0x2ce) [0x
00000000679f5bce]
C:\Ruby24-x64\bin\x64-msvcrt-ruby240.dll(ruby_cleanup+0x283) [0x00000000679e2823
]
C:\Ruby24-x64\bin\x64-msvcrt-ruby240.dll(ruby_run_node+0x60) [0x00000000679e2a10
]
 [0x0000000000402d57]
 [0x00000000004013f7]
 [0x000000000040152b]
C:\Windows\system32\kernel32.dll(BaseThreadInitThunk+0xd) [0x0000000076bc59cd]

-- Other runtime information -----------------------------------------------

* Loaded script: C:/Ruby24-x64/bin/jibril

* Loaded features:

	0 enumerator.so
	1 thread.rb
	2 rational.so
	3 complex.so
	4 C:/Ruby24-x64/lib/ruby/2.4.0/x64-mingw32/enc/encdb.so
	5 C:/Ruby24-x64/lib/ruby/2.4.0/x64-mingw32/enc/trans/transdb.so
	6 C:/Ruby24-x64/lib/ruby/2.4.0/x64-mingw32/enc/windows_1252.so
	7 C:/Ruby24-x64/lib/ruby/2.4.0/unicode_normalize.rb
	8 C:/Ruby24-x64/lib/ruby/2.4.0/x64-mingw32/rbconfig.rb
	9 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/compatibility.rb
   10 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/defaults.rb
   11 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/deprecate.rb
   12 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/errors.rb
   13 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/version.rb
   14 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/requirement.rb
   15 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/platform.rb
   16 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/basic_specification.rb
   17 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/stub_specification.rb
   18 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/util/list.rb
   19 C:/Ruby24-x64/lib/ruby/2.4.0/x64-mingw32/stringio.so
   20 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/specification.rb
   21 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/exceptions.rb
   22 C:/Ruby24-x64/lib/ruby/site_ruby/2.4.0/ruby_installer/runtime/singleton.rb

   23 C:/Ruby24-x64/lib/ruby/site_ruby/2.4.0/ruby_installer/runtime.rb
   24 C:/Ruby24-x64/lib/ruby/site_ruby/2.4.0/ruby_installer/runtime/msys2_instal
lation.rb
   25 C:/Ruby24-x64/lib/ruby/2.4.0/x64-mingw32/fiddle.so
   26 C:/Ruby24-x64/lib/ruby/2.4.0/fiddle/function.rb
   27 C:/Ruby24-x64/lib/ruby/2.4.0/fiddle/closure.rb
   28 C:/Ruby24-x64/lib/ruby/2.4.0/fiddle.rb
   29 C:/Ruby24-x64/lib/ruby/site_ruby/2.4.0/ruby_installer/runtime/dll_director
y.rb
   30 C:/Ruby24-x64/lib/ruby/2.4.0/x64-mingw32/enc/utf_16le.so
   31 C:/Ruby24-x64/lib/ruby/2.4.0/x64-mingw32/enc/trans/utf_16_32.so
   32 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/defaults/operating_system.rb
   33 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/dependency.rb
   34 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_gem.rb
   35 C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb
   36 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb
   37 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems.rb
   38 C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/path_support.rb
   39 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.2/lib/did_you_mean
/version.rb
   40 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.2/lib/did_you_mean
/core_ext/name_error.rb
   41 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.2/lib/did_you_mean
/levenshtein.rb
   42 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.2/lib/did_you_mean
/jaro_winkler.rb
   43 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.2/lib/did_you_mean
/spell_checker.rb
   44 C:/Ruby24-x64/lib/ruby/2.4.0/delegate.rb
   45 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.2/lib/did_you_mean
/spell_checkers/name_error_checkers/class_name_checker.rb
   46 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.2/lib/did_you_mean
/spell_checkers/name_error_checkers/variable_name_checker.rb
   47 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.2/lib/did_you_mean
/spell_checkers/name_error_checkers.rb
   48 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.2/lib/did_you_mean
/spell_checkers/method_name_checker.rb
   49 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.2/lib/did_you_mean
/spell_checkers/null_checker.rb
   50 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.2/lib/did_you_mean
/formatter.rb
   51 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.2/lib/did_you_mean
.rb
   52 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/tk-0.2.0/lib/tcltklib.so
   53 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/tk-0.2.0/lib/tkutil.so
   54 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/tk-0.2.0/lib/tk/ttk_selector.rb
   55 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/tk-0.2.0/lib/tk/autoload.rb
   56 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/tk-0.2.0/lib/tk/event.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Version

ruby 2.4.2p198 (2017-09-14 revision 59899) [x64-mingw32]

Program

#!/usr/bin/env ruby

require 'tk'
require 'tkextlib/tkimg'

$root = TkRoot.new do
  title 'Jibril'
end
icon = TkPhotoImage.new('file' => File.join(__dir__, '..', 'res', 'jibril.ico'))
$root.iconphoto(icon)

$btn = TkButton.new($root) do
  text 'Hide'
  command { $root.withdraw }
  pack({ 'padx' => 10, 'pady' => 10 })
end

Tk.mainloop

Environment is cleanly installed Window 7 virtual machine with 2.4.2 rubyinstaller ruby and tk 0.2.0.

Any idea what is going on and how can I work around it?

EDIT: oh, and it happens just sometimes, I would say about 1 in 20 runs.
EDIT2: can reproduce both in 32 and 64 bit version.

Support for Tcl/Tk 8.7

I am a member of the core Tcl/Tk development team and have wanting to test Ruby-Tk against some recent updates to the tip of Tk 8.7 in a Ruby app I maintain. I'm unable to build this gem against Tk 8.7 because it is listed as an unsupported version in extconf.rb. I have tried manually editing the file and also passing 8.7 as a configure flag ("--with-tcltkversion=8.7") but the build system seems to ignore these flags and/or overwrite my locally edited configuration. Can you either add support for Tcl/Tk 8.7 or provide guidance on how to override the restrictions in this gem? I understand that Tk 8.7 is not yet released, but it is maturing rapidly and it would be helpful to be able to build this gem against that version. Thank you.

tk on windows with ActiveTcl and ruby 3.2 crashing

Hi, I've followed the guide at https://tkdocs.com/tutorial/install.html#install-win-ruby.

I've installed the latest ruby at [Ruby+Devkit 3.2.3-1 (x64)] https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.2.3-1/rubyinstaller-devkit-3.2.3-1-x64.exe) and the latest ActiveTcl install ActiveTcl-8.6.13.0000-MSWin32-x64-559160e0.msii.

I've set the env vars, copied the dll's to ruby's bin as said in the guide.

The crash seems to have no further information other than it's just failed. Any ideas? Thanks.

H:\Development\tk_ruby_test>echo %TCL_LIBRARY%
C:\ActiveTcl\lib\tcl8.6

H:\Development\tk_ruby_test>echo %TK_LIBRARY%
C:\ActiveTcl\lib\tk8.6

H:\Development\tk_ruby_test>irb
irb(main):001:0> require "tk"
#<Thread:0x000002976c3a1938 C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/tk-0.5.0/lib/tk.rb:1178 run> terminated with exception (report_on_exception is true):
C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/tk-0.5.0/lib/tk.rb:32:in `initialize': tcltklib: fail to Tk_Init().  (RuntimeError)
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/tk-0.5.0/lib/tk.rb:32:in `initialize'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/tk-0.5.0/lib/tk.rb:1181:in `new'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/tk-0.5.0/lib/tk.rb:1181:in `block in <module:TkCore>'
C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/tk-0.5.0/lib/tk.rb:32:in `initialize': tcltklib: fail to Tk_Init().  (RuntimeError)
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/tk-0.5.0/lib/tk.rb:32:in `initialize'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/tk-0.5.0/lib/tk.rb:1181:in `new'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/tk-0.5.0/lib/tk.rb:1181:in `block in <module:TkCore>'
<internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require': cannot load such file -- tk (LoadError)
        from <internal:C:/Ruby32-x64/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
        from (irb):1:in `<main>'
        from C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/irb-1.6.2/exe/irb:11:in `<top (required)>'
        from C:/Ruby32-x64/bin/irb:33:in `load'
        from C:/Ruby32-x64/bin/irb:33:in `<main>'
irb(main):002:0>

Small warnings issued by the tk gem - could these be removed by someone with commit access?

Hello there.

Requiring the tk-gem leads to lots of warning messages.

I'll go through them:

https://github.com/ruby/tk/blob/master/lib/tk.rb#L821

/root/.gem/gems/tk-0.3.0/lib/tk.rb:821: warning: assigned but unused variable - id

The line:

id = "c" + TkCore::INTERP._ip_id_ + TkComm::Tk_IDs[0]

I would probably simply add an explicit return, or just "id" as the last value there:

return id

https://github.com/ruby/tk/blob/master/lib/tk.rb#L3490

/root/.gem/gems/tk-0.3.0/lib/tk.rb:3491: warning: assigned but unused variable - e

The line:

rescue => e

I would either remove the "=> e" part, or if you want to keep it:

rescue => _e
rescue => _error
rescue => _exception

Something like that.

Hmm many more such small warnings, at lines
3551, 3807, 3951, 4054.

Also a method is redefined here:

/root/.gem/gems/tk-0.3.0/lib/tk.rb:1369: warning: method redefined; discarding old to_s

Not sure why.

At line 887:

/root/.gem/gems/tk-0.3.0/lib/tk.rb:887: warning: instance variable @cmdtbl not initialized

This one is not initialized. Perhaps a reset() method or something like this
could be used to initialite all these variables.

/root/.gem/gems/tk-0.3.0/lib/tk.rb:2533: warning: instance variable encoding_table not initialized

Then another small warning in winfo.rb:

/root/.gem/gems/tk-0.3.0/lib/tk/winfo.rb:242: warning: parentheses after method name is interpreted as an argument list, not a decomposed argument

And some warnings like:

/root/.gem/gems/tk-0.3.0/lib/tk.rb:2855: warning: instance variable @encoding not initialized

Perhaps if someone with commit rights could go through these? These are mostly trivial
to fix; not sure if it is possible to do so via the web-interface.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.