Skip to content

Commit

Permalink
Fix for change to internal representation of methods (#133)
Browse files Browse the repository at this point in the history
* Fix for change to internal representation of methods

* Whoops
  • Loading branch information
ararslan authored and tkelman committed Mar 26, 2017
1 parent de1d425 commit b2e9baf
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,18 @@ winfo(widget::Widget, prop::AbstractString) = winfo(widget, prop, nothing)
wm(window::Widget, prop::AbstractString, args...; kwargs...) = tcl("wm", prop, window, args...; kwargs...)


if VERSION >= v"0.6.0-pre.alpha.244"
_slots(m::Method) = (Base.uncompressed_ast(m).slotnames, m.nargs)
elseif VERSION >= v"0.6.0-dev.624"
_slots(m::Method) = (m.source.slotnames, m.nargs)
else
_slots(m::Method) = (m.lambda_template.slotnames, m.lambda_template.nargs)
end

## Take a function, get its args as array of symbols. There must be better way...
## Helper functions for bind callback
function get_args(f::Function)
m = first(methods(f))
@static if VERSION >= v"0.6.0-dev.624"
slots = m.source.slotnames
n = m.nargs
else
slots = m.lambda_template.slotnames
n = m.lambda_template.nargs
end
slots, n = _slots(first(methods(f)))
argnames = slots[1:n]
return _arg_offset == 0 ? argnames : argnames[_arg_offset:end]
end
Expand Down

0 comments on commit b2e9baf

Please sign in to comment.