Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frequent error of "no method matching Tk.TkWidget(::String, ::String)" when using Images.jl #50

Closed
cvcore opened this issue May 2, 2017 · 7 comments

Comments

@cvcore
Copy link

cvcore commented May 2, 2017

Description

This problem happens to be every time I use Images.jl inside juno.

Reproduction Guide

Inside Atom, with uber-juno installed, type:
cmd-j cmd-o to open console, then:

using Images, ImageView, TestImages to import related package(you may need to install them first) and
img=testimage("mandrill") to request the test image. After this command atom will throw out an error:

Error displaying Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}: MethodError: no method matching Tk.TkWidget(::String, ::String)
Closest candidates are:
  Tk.TkWidget(!Matched::Tk.TkWidget, ::Any) at /Users/core/.julia/v0.5/Tk/src/tkwidget.jl:110
  Tk.TkWidget{T}(::Any) at sysimg.jl:53
 in #make_widget#54(::Array{Any,1}, ::Function, ::String, ::String) at core.jl:211
 in #Text#74(::Array{Any,1}, ::Type{T}, ::String) at widgets.jl:48
 in render(::Juno.Inline, ::Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}) at system.jl:179
 in render at view.jl:51 [inlined]
 in render(::Juno.Console, ::Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}) at types.jl:16
 in render′(::Juno.Console, ::Array{ColorTypes.RGB{FixedPointNumbers.Normed{UInt8,8}},2}) at errors.jl:89
 in (::Atom.##65#68)() at eval.jl:104
 in withpath(::Atom.##65#68, ::Void) at utils.jl:30
 in withpath(::Function, ::Void) at eval.jl:38
 in macro expansion at eval.jl:101 [inlined]
 in (::Atom.##64#67{Dict{String,Any}})() at task.jl:60

Currently you can inspect the content of an image by display(MIME("text/plain"), img) but that's far too unfriendly.

System Info

Atom 1.16.0 w/ uber-juno 0.1.1
Julia Version 0.5.1 Commit 6445c82 (2017-03-05 13:25 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin13.4.0)
CPU: Intel(R) Core(TM) i7-3540M CPU @ 3.00GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.7.1 (ORCJIT, ivybridge)

@pfitzseb
Copy link
Member

pfitzseb commented May 2, 2017

I'm pretty sure this happens because of JuliaGraphics/Tk.jl#117. Not sure what the best way forward is though.

@cvcore
Copy link
Author

cvcore commented May 2, 2017

@pfitzseb So is there anything can be done on juno's side? If I try it in jupyter everything seemed normal.

@pfitzseb
Copy link
Member

pfitzseb commented May 2, 2017

We could use Text{typeof(x)}(x) instead of Text(x) I think, but that's pretty ugly. Jupyter apparently doesn't use Base.Text, so it's not an issue for their setup. I'll also look into alternatives though.

@pfitzseb
Copy link
Member

pfitzseb commented May 2, 2017

Changing this line to import Base: ==, bind, getindex, isequal, parent, setindex!, show, string solves the immediate problem, btw. Not sure what this might break though.

@cvcore
Copy link
Author

cvcore commented May 2, 2017

@pfitzseb thanks for the quick workaround. I will test it for a while and get back if anything happens.

@pfitzseb
Copy link
Member

pfitzseb commented May 2, 2017

For reference: JuliaGraphics/Tk.jl#138

@cvcore
Copy link
Author

cvcore commented May 30, 2017

So far so good.

@cvcore cvcore closed this as completed May 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants