Packing Canvas Throws MethodError
I attempted to run the sketch_window() function in sketch.jl but when it evaluates the line that packs the canvas it throws the following:
ERROR: MethodError: pack(::Canvas) is ambiguous. Candidates: pack(c::Canvas, args...) in Tk at C:\Users\rteehan\.julia\packages\Tk\c8ZUf\src\tkwidget.jl:411 pack(widget::Union{AbstractString, Canvas, Tk.TkWidget, Tk_Widget}; kwargs...) in Tk at C:\Users\rteehan\.julia\packages\Tk\c8ZUf\src\containers.jl:117 Possible fix, define pack(::Canvas)
It seems like the example is failing because of an ambiguous overloaded function definition.
Seems like a bug. I'll take a look.
I'm sorry suddenly. I haven't seen all the code, but I think the following changes will fix it. Erase the following part, https://github.com/JuliaGraphics/Tk.jl/blob/5d704d285ccffd4eb82ba783ec181d75f5d69b28/src/tkwidget.jl#L411-L413 and here https://github.com/JuliaGraphics/Tk.jl/blob/5d704d285ccffd4eb82ba783ec181d75f5d69b28/src/containers.jl#L117 How about changing it like this?
function pack(widget::Widget, kwargs...)
if typeof(widget) == Canvas
widget = widget.c
end
tcl("pack", widget; kwargs...)
end
pack(canvas.c) is a workaround.