diff --git a/.travis.yml b/.travis.yml index 4a20ad5..110c37f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: julia os: - linux julia: - - 0.3 - 0.4 - 0.5 - nightly diff --git a/REQUIRE b/REQUIRE index 7af5776..1eb4d68 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,5 +1,5 @@ -julia 0.3 -Compat 0.7.16 +julia 0.4 +Compat 0.7.20 Cairo Graphics 0.1 BinDeps 0.2.2- diff --git a/deps/build.jl b/deps/build.jl index 46be6c8..9ed09a2 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -5,11 +5,11 @@ using Compat; import Compat.String tcl = library_dependency("tcl",aliases=["libtcl8.6","tcl86g","tcl86t","libtcl","libtcl8.6.so.0","libtcl8.5","libtcl8.5.so.0","tcl85"]) tk = library_dependency("tk",aliases=["libtk8.6","libtk","libtk8.6.so.0","libtk8.5","libtk8.5.so.0","tk85","tk86","tk86t"], depends=[tcl], validate = function(p,h) - @osx_only return @compat Libdl.dlsym_e(h,:TkMacOSXGetRootControl) != C_NULL + is_apple() && (return @compat Libdl.dlsym_e(h,:TkMacOSXGetRootControl) != C_NULL) return true end) -@windows_only begin +if is_windows() using WinRPM provides(WinRPM.RPM,"tk",tk,os = :Windows) provides(WinRPM.RPM,"tcl",tcl,os = :Windows) @@ -21,12 +21,12 @@ provides(AptGet,"tk8.5",tk) provides(Sources,URI("http://prdownloads.sourceforge.net/tcl/tcl8.6.0-src.tar.gz"),tcl,unpacked_dir = "tcl8.6.0") provides(Sources,URI("http://prdownloads.sourceforge.net/tcl/tk8.6.0-src.tar.gz"),tk,unpacked_dir = "tk8.6.0") -is64bit = WORD_SIZE == 64 +is64bit = @compat Sys.WORD_SIZE == 64 provides(BuildProcess,Autotools(configure_subdir = "unix", configure_options = [is64bit?"--enable-64bit":"--disable-64bit"]),tcl, os = :Unix) provides(BuildProcess,Autotools(configure_subdir = "unix", configure_options = [is64bit?"--enable-64bit":"--disable-64bit"]),tk, os = :Unix) -if WORD_SIZE == 64 +if @compat Sys.WORD_SIZE == 64 # Unfortunately the mingw-built tc segfaults since some function signatures # are different between VC and mingw. This is fixed on tcl trunk. For now, # just use VC to build tcl (Note requlres Visual Studio Express in the PATH) diff --git a/examples/manipulate.jl b/examples/manipulate.jl index e843d6b..f1ece0c 100644 --- a/examples/manipulate.jl +++ b/examples/manipulate.jl @@ -136,7 +136,7 @@ function manipulate(ex::(@compat Union{Symbol,Expr}), controls...) function dict_to_module(d::Dict) ## stuff values into Manipulate Context for (k,v) in d - eval(ManipulateContext, :($(symbol(k)) = $v)) + eval(ManipulateContext, :($(Symbol(k)) = $v)) end end @@ -165,8 +165,8 @@ ex = quote s = sin(x) p = FramedPlot() setattr(p, "title", title) - if - fillbetween add(p, FillBetween(x, c, x, s) ) + if fillbetween + add(p, FillBetween(x, c, x, s) ) end add(p, Curve(x, c, "color", color) ) add(p, Curve(x, s, "color", "blue") ) diff --git a/examples/workspace.jl b/examples/workspace.jl index 37cc86e..5308485 100644 --- a/examples/workspace.jl +++ b/examples/workspace.jl @@ -20,7 +20,7 @@ function update_ids(m::Module) global __ids__ nms = get_names(m) nms = filter(u -> u != "__ids__", nms) - a_ids = map(u -> unique_id(symbol(u), m), nms) + a_ids = map(u -> unique_id(Symbol(u), m), nms) if __ids__ == a_ids false else @@ -47,9 +47,9 @@ function get_names_summaries(m::Module, pat::MaybeRegex, dtype::MaybeType, dtype end ## filter out this type if dtype != nothing - nms = filter(u -> isdefined(m, symbol(u)) && negate(isa(eval(m,symbol(u)), dtype), dtypefilter), nms) + nms = filter(u -> isdefined(m, Symbol(u)) && negate(isa(eval(m,Symbol(u)), dtype), dtypefilter), nms) end - summaries = map(u -> isdefined(m, symbol(u)) ? short_summary(eval(m,symbol(u))) : "undefined", nms) + summaries = map(u -> isdefined(m, Symbol(u)) ? short_summary(eval(m,Symbol(u))) : "undefined", nms) if length(nms) == length(summaries) return [nms summaries] @@ -75,7 +75,7 @@ scrollbars_add(f, tv) ## add a callback. Here we get the obj clicked on. callback_add(tv, (path) -> begin val = get_value(tv)[1] - obj = eval(Main, symbol(val)) + obj = eval(Main, Symbol(val)) println(short_summary(obj)) end) diff --git a/src/core.jl b/src/core.jl index 3e03946..b5166bd 100644 --- a/src/core.jl +++ b/src/core.jl @@ -201,7 +201,7 @@ function bindwheel(widget::Widget, modifier::AbstractString, callback::Function, tkargs = string(" ", tkargs) end ccb = tcl_callback(callback) - if OS_NAME == :Linux + if is_linux() tcl_eval("bind $(path) <$(modifier)Button-4> {$ccb -120$tkargs}") tcl_eval("bind $(path) <$(modifier)Button-5> {$ccb 120$tkargs}") else @@ -229,7 +229,7 @@ function callback_add(widget::Tk_Widget, callback::Function) :Tk_Text => "", :Tk_Treeview => "<>" ) - key = Base.symbol(split(string(typeof(widget)), '.')[end]) + key = Base.Symbol(split(string(typeof(widget)), '.')[end]) if haskey(events, key) event = events[key] if event == nothing diff --git a/src/menu.jl b/src/menu.jl index 53a8fac..fa41b08 100644 --- a/src/menu.jl +++ b/src/menu.jl @@ -54,7 +54,7 @@ function menu_add(widget::Tk_Menu, rb::Tk_Radio) end function tk_popup(widget::Tk_Widget, menu::Tk_Menu) - if OS_NAME == :Darwin + if is_apple() tcl_eval("bind $(widget.w.path) <2> {tk_popup $(menu.w.path) %X %Y}") tcl_eval("bind $(widget.w.path) {tk_popup $(menu.w.path) %X %Y}") else @@ -63,7 +63,7 @@ function tk_popup(widget::Tk_Widget, menu::Tk_Menu) end function tk_popup(c::Canvas, menu::Tk_Menu) - if OS_NAME == :Darwin + if is_apple() tcl_eval("bind $(c.c.path) <2> {tk_popup $(menu.w.path) %X %Y}") tcl_eval("bind $(c.c.path) {tk_popup $(menu.w.path) %X %Y}") else diff --git a/src/tkwidget.jl b/src/tkwidget.jl index 7e2d263..60363ac 100644 --- a/src/tkwidget.jl +++ b/src/tkwidget.jl @@ -266,7 +266,7 @@ function reveal(c::Canvas) end @static if is_apple() -if WORD_SIZE == 32 +if @compat Sys.WORD_SIZE == 32 typealias CGFloat Float32 else typealias CGFloat Float64