From 2221480a0ed5aeffc2f39c945a0b398d61bca97d Mon Sep 17 00:00:00 2001
From: Alex Arslan <ararslan@comcast.net>
Date: Tue, 3 Apr 2018 22:56:08 -0700
Subject: [PATCH 1/6] Drop 0.5 support, fix some 0.7 deprecations

---
 .travis.yml            |   2 +-
 REQUIRE                |   4 +-
 deps/build.jl          |  21 +++---
 examples/manipulate.jl |  22 +++---
 examples/sketch.jl     |   6 +-
 examples/test.jl       |   6 +-
 examples/workspace.jl  |   6 +-
 src/Tk.jl              |  11 +--
 src/containers.jl      |  14 ++--
 src/core.jl            |  28 +++-----
 src/dialogs.jl         |   2 +-
 src/menu.jl            |   4 +-
 src/tkwidget.jl        | 159 +++++++++++++++++++++--------------------
 src/types.jl           |  18 ++---
 test/runtests.jl       |   3 +-
 15 files changed, 149 insertions(+), 157 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 20d27ab..60d9c19 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,7 +3,7 @@ os:
     - linux
     - osx
 julia:
-    - 0.5
+    - 0.6
     - nightly
 notifications:
     email: false
diff --git a/REQUIRE b/REQUIRE
index 13eee6a..721e80b 100644
--- a/REQUIRE
+++ b/REQUIRE
@@ -1,5 +1,5 @@
-julia 0.5
-Compat 0.17.0
+julia 0.6
+Compat 0.48.0
 Cairo
 Graphics 0.1
 BinDeps 0.2.2-
diff --git a/deps/build.jl b/deps/build.jl
index 9ed09a2..c6547b6 100644
--- a/deps/build.jl
+++ b/deps/build.jl
@@ -1,15 +1,16 @@
 using BinDeps
-using Compat; import Compat.String
+using Compat
+using Compat.Libdl
 
 @BinDeps.setup
 
 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)
-    is_apple() && (return @compat Libdl.dlsym_e(h,:TkMacOSXGetRootControl) != C_NULL)
+    Compat.Sys.isapple() && (return Libdl.dlsym_e(h,:TkMacOSXGetRootControl) != C_NULL)
     return true
 end)
 
-if is_windows()
+if Compat.Sys.iswindows()
     using WinRPM
     provides(WinRPM.RPM,"tk",tk,os = :Windows)
     provides(WinRPM.RPM,"tcl",tcl,os = :Windows)
@@ -21,12 +22,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 = @compat Sys.WORD_SIZE == 64
+is64bit = 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)
+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 @compat Sys.WORD_SIZE == 64
+if 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)
@@ -48,8 +49,8 @@ if @compat Sys.WORD_SIZE == 64
                 end
         end),tk)
 else
-        provides(BuildProcess,Autotools(libtarget = "tcl86.dll", configure_subdir = "win", configure_options = [is64bit?"--enable-64bit":"--disable-64bit","--enable-threads"]),tcl, os = :Windows)
-        provides(BuildProcess,Autotools(libtarget = "tk86.dll", configure_subdir = "win", configure_options = [is64bit?"--enable-64bit":"--disable-64bit"]),tk, os = :Windows)
+        provides(BuildProcess,Autotools(libtarget = "tcl86.dll", configure_subdir = "win", configure_options = [is64bit ? "--enable-64bit" : "--disable-64bit","--enable-threads"]),tcl, os = :Windows)
+        provides(BuildProcess,Autotools(libtarget = "tk86.dll", configure_subdir = "win", configure_options = [is64bit ? "--enable-64bit" : "--disable-64bit"]),tk, os = :Windows)
 end
 
-@BinDeps.install @compat(Dict(:tk => :libtk, :tcl=>:libtcl))
+@BinDeps.install Dict(:tk => :libtk, :tcl=>:libtcl)
diff --git a/examples/manipulate.jl b/examples/manipulate.jl
index 4ee05fb..e7b0819 100644
--- a/examples/manipulate.jl
+++ b/examples/manipulate.jl
@@ -25,10 +25,10 @@ using Winston
 end
 
 
-@compat abstract type ManipulateWidget end
+abstract type ManipulateWidget end
 get_label(widget::ManipulateWidget) = widget.label
 
-type SliderWidget <: ManipulateWidget
+mutable struct SliderWidget <: ManipulateWidget
     nm
     label
     initial
@@ -44,7 +44,7 @@ slider(nm::AbstractString, label::AbstractString, rng::UnitRange, initial::Integ
 slider(nm::AbstractString, label::AbstractString, rng::UnitRange) = slider(nm, label, rng, minimum(rng))
 slider(nm::AbstractString,  rng::UnitRange) = slider(nm, nm, rng, minimum(rng))
 
-type PickerWidget <: ManipulateWidget
+mutable struct PickerWidget <: ManipulateWidget
     nm
     label
     initial
@@ -60,14 +60,14 @@ function make_widget(parent, widget::PickerWidget)
 end
 
 
-picker{T <: AbstractString}(nm::AbstractString, label::AbstractString, vals::Vector{T}, initial) = PickerWidget(nm, label, initial, vals)
-picker{T <: AbstractString}(nm::AbstractString, label::AbstractString, vals::Vector{T}) = picker(nm, label, vals, vals[1])
-picker{T <: AbstractString}(nm::AbstractString, vals::Vector{T}) = picker(nm, nm, vals)
+picker(nm::AbstractString, label::AbstractString, vals::Vector{T}, initial) where {T <: AbstractString} = PickerWidget(nm, label, initial, vals)
+picker(nm::AbstractString, label::AbstractString, vals::Vector{T}) where {T <: AbstractString} = picker(nm, label, vals, vals[1])
+picker(nm::AbstractString, vals::Vector{T}) where {T <: AbstractString} = picker(nm, nm, vals)
 picker(nm::AbstractString, label::AbstractString, vals::Dict, initial) = PickerWidget(nm, label, vals, initial)
 picker(nm::AbstractString, label::AbstractString, vals::Dict) = PickerWidget(nm, label, vals, [string(k) for (k,v) in vals][1])
 picker(nm::AbstractString, vals::Dict) = picker(nm, nm, vals)
 
-type CheckboxWidget <: ManipulateWidget
+mutable struct CheckboxWidget <: ManipulateWidget
     nm
     label
     initial
@@ -83,7 +83,7 @@ checkbox(nm::AbstractString, label::AbstractString, initial::Bool) = CheckboxWid
 checkbox(nm::AbstractString, label::AbstractString) = checkbox(nm, label, false)
 
 
-type ButtonWidget <: ManipulateWidget
+mutable struct ButtonWidget <: ManipulateWidget
     label
     nm
 end
@@ -93,7 +93,7 @@ button(label::AbstractString) = ButtonWidget(label, nothing)
 
 
 ## Add text widget to gather one-line of text
-type EntryWidget <: ManipulateWidget
+mutable struct EntryWidget <: ManipulateWidget
     nm
     label
     initial
@@ -105,7 +105,7 @@ entry(nm::AbstractString) = EntryWidget(nm, nm, "{}")
 
 
 ## Expression returns a plot object. Use names as values
-function manipulate(ex::(@compat Union{Symbol,Expr}), controls...)
+function manipulate(ex::(Union{Symbol,Expr}), controls...)
     widgets = Array(Tk.Widget, 0)
 
     w = Toplevel("Manipulate", 800, 500)
@@ -127,7 +127,7 @@ function manipulate(ex::(@compat Union{Symbol,Expr}), controls...)
         d = Dict()                      # return Dict of values
         vals = get_values(); keys = get_nms()
         for i in 1:length(vals)
-            if !isa(keys[i], @compat Void)
+            if !isa(keys[i], Nothing)
                 d[keys[i]] = vals[i]
             end
         end
diff --git a/examples/sketch.jl b/examples/sketch.jl
index 5a2f68f..18c3c6f 100644
--- a/examples/sketch.jl
+++ b/examples/sketch.jl
@@ -1,9 +1,5 @@
 using Tk
-if VERSION < v"0.4.0-dev+3275"
-    using Base.Graphics
-else
-    using Graphics
-end
+using Graphics
 
 function sketch_window()
     w = Window("drawing", 400, 300)
diff --git a/examples/test.jl b/examples/test.jl
index 9405dd5..87ecd51 100644
--- a/examples/test.jl
+++ b/examples/test.jl
@@ -6,7 +6,7 @@ using Compat; import Compat.String
 w = Toplevel("Test window", false)
 ## pack in tk frame for themed widgets
 f = Frame(w)
-configure(f, @compat Dict(:padding => [3,3,2,2], :relief=>"groove"))
+configure(f, Dict(:padding => [3,3,2,2], :relief=>"groove"))
 pack(f, expand=true, fill="both")
 
 ## widgets
@@ -26,11 +26,11 @@ pack_style = ["pack", "grid", "formlayout"][3]
 
 if pack_style == "pack"
     map(pack, widgets)
-    map(u -> pack_configure(u, @compat Dict(:anchor => "w")), widgets)
+    map(u -> pack_configure(u, Dict(:anchor => "w")), widgets)
 elseif pack_style == "grid"
     for i in 1:length(widgets)
         grid(widgets[i], i, 1)
-        grid_configure(widgets[i], @compat Dict(:sticky => "we"))
+        grid_configure(widgets[i], Dict(:sticky => "we"))
     end
 else
     map(u -> formlayout(u, "label"), widgets)
diff --git a/examples/workspace.jl b/examples/workspace.jl
index e7bd4e7..88a8caa 100644
--- a/examples/workspace.jl
+++ b/examples/workspace.jl
@@ -7,7 +7,7 @@ function get_names(m::Module)
 end
 
 unique_id(v::Symbol, m::Module) = isdefined(m,v) ? unique_id(eval(m,v)) : ""
-unique_id(x) = string(object_id(x))
+unique_id(x) = string(objectid(x))
 
 ## short_summary
 ## can customize description here
@@ -31,8 +31,8 @@ end
 
 
 negate(x::Bool, val::Bool) = val ? !x : x
-const MaybeRegex = Union{Void, Regex}
-const MaybeType = Union{Void, DataType}
+const MaybeRegex = Union{Nothing, Regex}
+const MaybeType = Union{Nothing, DataType}
 
 ## get array of names and summaries
 ## m module
diff --git a/src/Tk.jl b/src/Tk.jl
index 0ad64d8..2164f24 100644
--- a/src/Tk.jl
+++ b/src/Tk.jl
@@ -1,4 +1,4 @@
-VERSION >= v"0.4.0-dev+6521" && __precompile__(false)
+__precompile__(false)
 
 # julia tk interface
 # TODO:
@@ -14,9 +14,8 @@ VERSION >= v"0.4.0-dev+6521" && __precompile__(false)
 
 
 module Tk
-using Base
 using Cairo
-using Compat; import Compat.String
+using Compat
 
 if isfile(joinpath(dirname(@__FILE__),"..","deps","deps.jl"))
     include("../deps/deps.jl")
@@ -26,11 +25,7 @@ end
 
 import Base: ==, bind, getindex, isequal, parent, setindex!, show, string, Text
 
-if VERSION < v"0.4.0-dev+3275"
-    import Base.Graphics: width, height, getgc
-else
-    import Graphics: width, height, getgc
-end
+import Graphics: width, height, getgc
 
 import Cairo: destroy
 
diff --git a/src/containers.jl b/src/containers.jl
index 007f2b1..d1abc1b 100644
--- a/src/containers.jl
+++ b/src/containers.jl
@@ -1,9 +1,9 @@
 ## Types
-type Tk_Toplevel    <: TTk_Container w::TkWidget; children::Vector{Tk_Widget} end
-type Tk_Frame       <: TTk_Container w::TkWidget; children::Vector{Tk_Widget} end
-type Tk_Labelframe  <: TTk_Container w::TkWidget; children::Vector{Tk_Widget} end
-type Tk_Notebook    <: TTk_Container w::TkWidget; children::Vector{Tk_Widget} end
-type Tk_Panedwindow <: TTk_Container w::TkWidget; children::Vector{Tk_Widget} end
+mutable struct Tk_Toplevel    <: TTk_Container w::TkWidget; children::Vector{Tk_Widget} end
+mutable struct Tk_Frame       <: TTk_Container w::TkWidget; children::Vector{Tk_Widget} end
+mutable struct Tk_Labelframe  <: TTk_Container w::TkWidget; children::Vector{Tk_Widget} end
+mutable struct Tk_Notebook    <: TTk_Container w::TkWidget; children::Vector{Tk_Widget} end
+mutable struct Tk_Panedwindow <: TTk_Container w::TkWidget; children::Vector{Tk_Widget} end
 
 ==(a::TTk_Container, b::TTk_Container) = isequal(a.w, b.w) && typeof(a) == typeof(b)
 
@@ -23,7 +23,7 @@ width(widget::Tk_Toplevel) = parse(Int, winfo(widget, "width"))
 height(widget::Tk_Toplevel) = parse(Int, winfo(widget, "height"))
 get_size(widget::Tk_Toplevel) = [width(widget), height(widget)]
 set_size(widget::Tk_Toplevel,  width::Integer, height::Integer) = wm(widget, "geometry", "$(string(width))x$(string(height))")
-set_size{T <: Integer}(widget::Tk_Toplevel, widthheight::Vector{T}) = set_size(widget, widthheight[1], widthheight[2])
+set_size(widget::Tk_Toplevel, widthheight::Vector{T}) where {T <: Integer} = set_size(widget, widthheight[1], widthheight[2])
 
 
 
@@ -52,7 +52,7 @@ function set_position(widget::Tk_Toplevel, x::Integer, y::Integer)
     p_or_m(x) = x < 0 ? "$x" : "+$x"
     wm(widget, "geometry", I(p_or_m(x) * p_or_m(y)))
 end
-set_position{T <: Integer}(widget::Tk_Toplevel, pos::Vector{T}) = set_position(w, pos[1], pos[2])
+set_position(widget::Tk_Toplevel, pos::Vector{T}) where {T <: Integer} = set_position(w, pos[1], pos[2])
 set_position(widget::Tk_Toplevel, pos::Tk_Widget) = set_position(widget, Integer[parse(Int, winfo(pos, i)) for i in ["x", "y"]] + [10,10])
 
 update(widget::Tk_Toplevel) = wm(widget, "geometry")
diff --git a/src/core.jl b/src/core.jl
index e8c673b..5074cad 100644
--- a/src/core.jl
+++ b/src/core.jl
@@ -16,14 +16,14 @@ get_path(widget::Canvas) = get_path(widget.c) # Tk.Canvas object
 
 ## Coversion of julia objects into tcl strings for inclusion via tcl() call
 to_tcl(x) = string(x)
-to_tcl(x::Void) = ""
+to_tcl(x::Nothing) = ""
 has_space = r" "
 to_tcl(x::AbstractString) = ismatch(has_space, x) ? "{$x}" : x
-type I x::MaybeString end               #  avoid wrapping in {} and ismatch call.
+mutable struct I x::MaybeString end               #  avoid wrapping in {} and ismatch call.
 macro I_str(s) I(s) end
 to_tcl(x::I) = x.x == nothing ? "" : x.x
-to_tcl{T <: Number}(x::Vector{T}) = "\"" * string(join(x, " ")) * "\""
-function to_tcl{T <: AbstractString}(x::Vector{T})
+to_tcl(x::Vector{T}) where {T <: Number} = "\"" * string(join(x, " ")) * "\""
+function to_tcl(x::Vector{T}) where T <: AbstractString
     tmp = join(["{$i}" for i in x], " ")
     "[list $tmp ]"
 end
@@ -80,7 +80,7 @@ function configure(widget::Widget, args...; kwargs...)
     tcl(widget, "configure", args...; kwargs...)
 end
 
-setindex!(widget::Widget, value, prop::Symbol) = configure(widget, @compat Dict(prop=>value))
+setindex!(widget::Widget, value, prop::Symbol) = configure(widget, Dict(prop=>value))
 
 ## Get values
 ## cget
@@ -110,13 +110,7 @@ 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
+_slots(m::Method) = (Base.uncompressed_ast(m).slotnames, m.nargs)
 
 ## Take a function, get its args as array of symbols. There must be better way...
 ## Helper functions for bind callback
@@ -164,7 +158,7 @@ function bindwheel(widget::Widget, modifier::AbstractString, callback::Function,
         tkargs = string(" ", tkargs)
     end
     ccb = tcl_callback(callback)
-    if is_linux()
+    if Compat.Sys.islinux()
         tcl_eval("bind $(path) <$(modifier)Button-4> {$ccb -120$tkargs}")
         tcl_eval("bind $(path) <$(modifier)Button-5> {$ccb 120$tkargs}")
     else
@@ -174,7 +168,7 @@ end
 
 ## add most typical callback
 function callback_add(widget::Tk_Widget, callback::Function)
-    events = @compat Dict(
+    events = Dict(
         :Tk_Window => "<Destroy>",
         :Tk_Frame => nothing,
         :Tk_Labelframe => nothing,
@@ -222,11 +216,11 @@ end
 ## function after a delay of ms milliseconds. This is started with
 ## obj.start() and stopped, if desired, with obj.stop(). To restart is
 ## possible, but first set obj.run=true.
-type TclAfter
+mutable struct TclAfter
     cb::Function
     run::Bool
-    start::Union{Void, Function}
-    stop::Union{Void, Function}
+    start::Union{Nothing, Function}
+    stop::Union{Nothing, Function}
     ms::Int
 
     function TclAfter(ms, cb::Function)
diff --git a/src/dialogs.jl b/src/dialogs.jl
index a7e447e..3e65f84 100644
--- a/src/dialogs.jl
+++ b/src/dialogs.jl
@@ -8,7 +8,7 @@ ChooseDirectory() = tcl("tk_chooseDirectory")
 ## Message box
 function Messagebox(parent::MaybeWidget; title::AbstractString="", message::AbstractString="", detail::AbstractString="")
     args = Dict()
-    if !isa(parent, Void) args["parent"] = get_path(parent) end
+    if !isa(parent, Nothing) args["parent"] = get_path(parent) end
     if length(title) > 0 args["title"] = title  end
     if length(message) > 0 args["message"] = message end
     if length(detail) > 0 args["detail"] = detail end
diff --git a/src/menu.jl b/src/menu.jl
index fa41b08..6b3f193 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 is_apple()
+    if Compat.Sys.isapple()
         tcl_eval("bind $(widget.w.path) <2> {tk_popup $(menu.w.path) %X %Y}")
         tcl_eval("bind $(widget.w.path) <Control-1> {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 is_apple()
+    if Compat.Sys.isapple()
         tcl_eval("bind $(c.c.path) <2> {tk_popup $(menu.w.path) %X %Y}")
         tcl_eval("bind $(c.c.path) <Control-1> {tk_popup $(menu.w.path) %X %Y}")
     else
diff --git a/src/tkwidget.jl b/src/tkwidget.jl
index dd33c5e..735cd7d 100644
--- a/src/tkwidget.jl
+++ b/src/tkwidget.jl
@@ -4,9 +4,9 @@ const TCL_RETURN   = convert(Int32, 2)
 const TCL_BREAK    = convert(Int32, 3)
 const TCL_CONTINUE = convert(Int32, 4)
 
-const TCL_VOLATILE = convert(Ptr{Void}, 1)
-const TCL_STATIC   = convert(Ptr{Void}, 0)
-const TCL_DYNAMIC  = convert(Ptr{Void}, 3)
+const TCL_VOLATILE = convert(Ptr{Cvoid}, 1)
+const TCL_STATIC   = convert(Ptr{Cvoid}, 0)
+const TCL_DYNAMIC  = convert(Ptr{Cvoid}, 3)
 
 tcl_doevent() = tcl_doevent(nothing,0)
 function tcl_doevent(timer,status=0)
@@ -24,19 +24,20 @@ end
 global timeout = nothing
 
 # fetch first word from struct
-tk_display(w) = pointer_to_array(convert(Ptr{Ptr{Void}},w), (1,), false)[1]
+tk_display(w) = pointer_to_array(convert(Ptr{Ptr{Cvoid}},w), (1,), false)[1]
 
 function init()
-    @static if is_apple() ccall(:CFBundleCreate, Ptr{Void}, (Ptr{Void}, Ptr{Void}), C_NULL,
-        ccall(:CFURLCreateWithFileSystemPath, Ptr{Void}, (Ptr{Void}, Ptr{Void}, Cint, Cint), C_NULL,
-            ccall(:CFStringCreateWithFileSystemRepresentation, Ptr{Void}, (Ptr{Void}, Ptr{UInt8}), C_NULL, "/System/Library/Frameworks/Tk.framework"),
-            0, 1))
+    @static if Compat.Sys.isapple()
+        ccall(:CFBundleCreate, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}), C_NULL,
+            ccall(:CFURLCreateWithFileSystemPath, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}, Cint, Cint), C_NULL,
+                ccall(:CFStringCreateWithFileSystemRepresentation, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{UInt8}), C_NULL, "/System/Library/Frameworks/Tk.framework"),
+                0, 1))
     end
-    ccall((:Tcl_FindExecutable,libtcl), Void, (Ptr{UInt8},),
-          joinpath(JULIA_HOME, "julia"))
-    ccall((:g_type_init,Cairo._jl_libgobject),Void,())
-    tclinterp = ccall((:Tcl_CreateInterp,libtcl), Ptr{Void}, ())
-    @static if is_windows()
+    ccall((:Tcl_FindExecutable,libtcl), Cvoid, (Ptr{UInt8},),
+          joinpath(Compat.Sys.BINDIR, "julia"))
+    ccall((:g_type_init,Cairo._jl_libgobject),Cvoid,())
+    tclinterp = ccall((:Tcl_CreateInterp,libtcl), Ptr{Cvoid}, ())
+    @static if Compat.Sys.iswindows()
         htcl = ccall((:GetModuleHandleA,:kernel32),stdcall,Csize_t,
             (Ptr{UInt8},),libtcl)
         tclfile = Vector{UInt8}(260)
@@ -55,33 +56,37 @@ function init()
             tcl_eval(takebuf_string(libpath),tclinterp)
         end
     end
-    if ccall((:Tcl_Init,libtcl), Int32, (Ptr{Void},), tclinterp) == TCL_ERROR
+    if ccall((:Tcl_Init,libtcl), Int32, (Ptr{Cvoid},), tclinterp) == TCL_ERROR
         throw(TclError(string("error initializing Tcl: ", tcl_result(tclinterp))))
     end
-    if ccall((:Tk_Init,libtk), Int32, (Ptr{Void},), tclinterp) == TCL_ERROR
+    if ccall((:Tk_Init,libtk), Int32, (Ptr{Cvoid},), tclinterp) == TCL_ERROR
         throw(TclError(string("error initializing Tk: ", tcl_result(tclinterp))))
     end
     global timeout
-    timeout = Timer(tcl_doevent,0.1,0.01)
+    @static if VERSION >= v"0.7.0-DEV.3526"
+        timeout = Timer(tcl_doevent, 0.1, interval=0.01)
+    else
+        timeout = Timer(tcl_doevent, 0.1, 0.01)
+    end
     tclinterp
 end
 
 mainwindow(interp) =
-    ccall((:Tk_MainWindow,libtk), Ptr{Void}, (Ptr{Void},), interp)
+    ccall((:Tk_MainWindow,libtk), Ptr{Cvoid}, (Ptr{Cvoid},), interp)
 mainwindow() = mainwindow(tcl_interp)
 
-type TclError <: Exception
+mutable struct TclError <: Exception
     msg::AbstractString
 end
 
 tcl_result() = tcl_result(tcl_interp)
 function tcl_result(tcl_interp)
     unsafe_string(ccall((:Tcl_GetStringResult,libtcl),
-                        Ptr{UInt8}, (Ptr{Void},), tcl_interp))
+                        Ptr{UInt8}, (Ptr{Cvoid},), tcl_interp))
 end
 
 function tcl_evalfile(name)
-    if ccall((:Tcl_EvalFile,libtcl), Int32, (Ptr{Void}, Ptr{UInt8}),
+    if ccall((:Tcl_EvalFile,libtcl), Int32, (Ptr{Cvoid}, Ptr{UInt8}),
              tcl_interp, name) != 0
         throw(TclError(tcl_result()))
     end
@@ -90,7 +95,7 @@ end
 
 tcl_eval(cmd) = tcl_eval(cmd,tcl_interp)
 function tcl_eval(cmd,tclinterp)
-    code = ccall((:Tcl_Eval,libtcl), Int32, (Ptr{Void}, Ptr{UInt8}),
+    code = ccall((:Tcl_Eval,libtcl), Int32, (Ptr{Cvoid}, Ptr{UInt8}),
                  tclinterp, cmd)
     result = tcl_result(tclinterp)
     if code != 0
@@ -100,10 +105,10 @@ function tcl_eval(cmd,tclinterp)
     end
 end
 
-type TkWidget
+mutable struct TkWidget
     path::String
     kind::String
-    parent::Union{TkWidget,Void}
+    parent::Union{TkWidget,Nothing}
     
     let ID::Int = 0
     function TkWidget(parent::TkWidget, kind)
@@ -130,8 +135,8 @@ Window(title) = Window(title, 200, 200)
 place(widget::TkWidget, x::Int, y::Int) = tcl_eval("place $(widget.path) -x $x -y $y")
 
 function nametowindow(name)
-    ccall((:Tk_NameToWindow,libtk), Ptr{Void},
-          (Ptr{Void}, Ptr{UInt8}, Ptr{Void}),
+    ccall((:Tk_NameToWindow,libtk), Ptr{Cvoid},
+          (Ptr{Cvoid}, Ptr{UInt8}, Ptr{Cvoid}),
           tcl_interp, name, mainwindow(tcl_interp))
 end
 
@@ -151,23 +156,23 @@ function jl_tcl_callback(fptr, interp, argc::Int32, argv::Ptr{Ptr{UInt8}})
         return TCL_ERROR
     end
     if isa(result,String)
-        ccall((:Tcl_SetResult,libtcl), Void, (Ptr{Void}, Ptr{UInt8}, Int32),
+        ccall((:Tcl_SetResult,libtcl), Cvoid, (Ptr{Cvoid}, Ptr{UInt8}, Int32),
               interp, result, TCL_VOLATILE)
     else
-        ccall((:Tcl_SetResult,libtcl), Void, (Ptr{Void}, Ptr{UInt8}, Int32),
+        ccall((:Tcl_SetResult,libtcl), Cvoid, (Ptr{Cvoid}, Ptr{UInt8}, Int32),
               interp, empty_str, TCL_STATIC)
     end
     return TCL_OK
 end
 
 jl_tcl_callback_ptr = cfunction(jl_tcl_callback,
-                                Int32, (Ptr{Void}, Ptr{Void}, Int32, Ptr{Ptr{UInt8}}))
+                                Int32, (Ptr{Cvoid}, Ptr{Cvoid}, Int32, Ptr{Ptr{UInt8}}))
 
 function tcl_callback(f)
-    cname = string("jl_cb", repr(object_id(f)))
+    cname = string("jl_cb", repr(objectid(f)))
     # TODO: use Tcl_CreateObjCommand instead
-    ccall((:Tcl_CreateCommand,libtcl), Ptr{Void},
-          (Ptr{Void}, Ptr{UInt8}, Ptr{Void}, Ptr{Void}, Ptr{Void}),
+    ccall((:Tcl_CreateCommand,libtcl), Ptr{Cvoid},
+          (Ptr{Cvoid}, Ptr{UInt8}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}),
           tcl_interp, cname, jl_tcl_callback_ptr, pointer_from_objref(f), C_NULL)
     # TODO: use a delete proc (last arg) to remove this
     _callbacks[f] = true
@@ -179,7 +184,7 @@ height(w::TkWidget) = parse(Int, tcl_eval("winfo height $(w.path)"))
 
 const default_mouse_cb = (w, x, y)->nothing
 
-type MouseHandler
+mutable struct MouseHandler
     button1press
     button1release
     button2press
@@ -196,7 +201,7 @@ end
 
 # TkCanvas is the plain Tk canvas widget. This one is double-buffered
 # and built on Cairo.
-type Canvas
+mutable struct Canvas
     c::TkWidget
     back::CairoSurface   # backing store
     backcc::CairoContext
@@ -265,15 +270,15 @@ function reveal(c::Canvas)
     tcl_doevent()
 end
 
-@static if is_apple()
+@static if Compat.Sys.isapple()
     if Sys.WORD_SIZE == 32
         const CGFloat = Float32
     else
         const CGFloat = Float64
     end
-    function objc_msgSend{T}(id, uid, ::Type{T}=Ptr{Void})
-        convert(T, ccall(:objc_msgSend, Ptr{Void}, (Ptr{Void}, Ptr{Void}),
-                         id, ccall(:sel_getUid, Ptr{Void}, (Ptr{UInt8},), uid)))
+    function objc_msgSend(id, uid, ::Type{T}=Ptr{Void}) where T
+        convert(T, ccall(:objc_msgSend, Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}),
+                         id, ccall(:sel_getUid, Ptr{Cvoid}, (Ptr{UInt8},), uid)))
     end
 end
 
@@ -282,7 +287,7 @@ end
 function render_to_cairo(f::Function, w::TkWidget, clipped::Bool=true)
     win = nametowindow(w.path)
     win == C_NULL && error("invalid window")
-    @static if is_linux()
+    @static if Compat.Sys.islinux()
         disp = jl_tkwin_display(win)
         d = jl_tkwin_id(win)
         vis = jl_tkwin_visual(win)
@@ -294,14 +299,14 @@ function render_to_cairo(f::Function, w::TkWidget, clipped::Bool=true)
         destroy(surf)
         return
     end
-    @static if is_apple()
+    @static if Compat.Sys.isapple()
         ## TkMacOSXSetupDrawingContext()
         drawable = jl_tkwin_id(win)
-        view = ccall((:TkMacOSXGetRootControl,libtk), Ptr{Void}, (Int,), drawable) # NSView*
+        view = ccall((:TkMacOSXGetRootControl,libtk), Ptr{Cvoid}, (Int,), drawable) # NSView*
         if view == C_NULL
             error("Invalid OS X window at getView")
         end
-        focusView = objc_msgSend(ccall(:objc_getClass, Ptr{Void}, (Ptr{UInt8},), "NSView"), "focusView");
+        focusView = objc_msgSend(ccall(:objc_getClass, Ptr{Cvoid}, (Ptr{UInt8},), "NSView"), "focusView");
         focusLocked = false
         if view != focusView
             focusLocked = objc_msgSend(view, "lockFocusIfCanDraw", Int32) != 0
@@ -316,7 +321,7 @@ function render_to_cairo(f::Function, w::TkWidget, clipped::Bool=true)
         objc_msgSend(window, "disableFlushWindow")
         context = objc_msgSend(objc_msgSend(window, "graphicsContext"), "graphicsPort")
         if !focusLocked
-            ccall(:CGContextSaveGState, Void, (Ptr{Void},), context)
+            ccall(:CGContextSaveGState, Cvoid, (Ptr{Cvoid},), context)
         end
         try
             ## TkMacOSXGetClipRgn
@@ -326,7 +331,7 @@ function render_to_cairo(f::Function, w::TkWidget, clipped::Bool=true)
                 if macDraw.winPtr != C_NULL
                     TK_CLIP_INVALID = 0x02 # 8.4, 8.5, 8.6
                     if macDraw.flags & TK_CLIP_INVALID != 0
-                        ccall((:TkMacOSXUpdateClipRgn,libtk), Void, (Ptr{Void},), macDraw.winPtr)
+                        ccall((:TkMacOSXUpdateClipRgn,libtk), Cvoid, (Ptr{Cvoid},), macDraw.winPtr)
                         macDraw = unsafe_load(convert(Ptr{TkWindowPrivate}, drawable))
                     end
                     clipRgn = if macDraw.drawRgn != C_NULL
@@ -338,16 +343,16 @@ function render_to_cairo(f::Function, w::TkWidget, clipped::Bool=true)
                     end
                 end
                 ##
-                ccall(:CGContextTranslateCTM, Void, (Ptr{Void}, CGFloat, CGFloat), context, 0, height(toplevel(w)))
-                ccall(:CGContextScaleCTM, Void, (Ptr{Void}, CGFloat, CGFloat), context, 1, -1)
+                ccall(:CGContextTranslateCTM, Cvoid, (Ptr{Cvoid}, CGFloat, CGFloat), context, 0, height(toplevel(w)))
+                ccall(:CGContextScaleCTM, Cvoid, (Ptr{Cvoid}, CGFloat, CGFloat), context, 1, -1)
                 if clipRgn != C_NULL
-                    if ccall(:HIShapeIsEmpty, UInt8, (Ptr{Void},), clipRgn) != 0
+                    if ccall(:HIShapeIsEmpty, UInt8, (Ptr{Cvoid},), clipRgn) != 0
                         return
                     end
-                    @assert 0 == ccall(:HIShapeReplacePathInCGContext, Cint, (Ptr{Void}, Ptr{Void}), clipRgn, context)
-                    ccall(:CGContextEOClip, Void, (Ptr{Void},), context)
+                    @assert 0 == ccall(:HIShapeReplacePathInCGContext, Cint, (Ptr{Cvoid}, Ptr{Cvoid}), clipRgn, context)
+                    ccall(:CGContextEOClip, Cvoid, (Ptr{Cvoid},), context)
                 end
-                ccall(:CGContextTranslateCTM, Void, (Ptr{Void}, CGFloat, CGFloat), context, macDraw.xOff, macDraw.yOff)
+                ccall(:CGContextTranslateCTM, Cvoid, (Ptr{Cvoid}, CGFloat, CGFloat), context, macDraw.xOff, macDraw.yOff)
                 ##
             end
             surf = CairoQuartzSurface(context, wi, hi)
@@ -358,26 +363,26 @@ function render_to_cairo(f::Function, w::TkWidget, clipped::Bool=true)
             end
         finally
             ## TkMacOSXRestoreDrawingContext
-            ccall(:CGContextSynchronize, Void, (Ptr{Void},), context)
+            ccall(:CGContextSynchronize, Cvoid, (Ptr{Cvoid},), context)
             objc_msgSend(window, "enableFlushWindow")
             if focusLocked
                 objc_msgSend(view, "unlockFocus")
             else
-                ccall(:CGContextRestoreGState, Void, (Ptr{Void},), context)
+                ccall(:CGContextRestoreGState, Cvoid, (Ptr{Cvoid},), context)
             end
         end
         ##
         return
     end
-    @static if is_windows()
+    @static if Compat.Sys.iswindows()
         state = Vector{UInt8}(sizeof(Int)*2) # 8.4, 8.5, 8.6
         drawable = jl_tkwin_id(win)
-        hdc = ccall((:TkWinGetDrawableDC,libtk), Ptr{Void}, (Ptr{Void}, Int, Ptr{UInt8}),
+        hdc = ccall((:TkWinGetDrawableDC,libtk), Ptr{Cvoid}, (Ptr{Cvoid}, Int, Ptr{UInt8}),
             jl_tkwin_display(win), drawable, state)
         surf = CairoWin32Surface(hdc, width(w), height(w))
         f(surf)
         destroy(surf)
-        ccall((:TkWinReleaseDrawableDC,libtk), Void, (Int, Int, Ptr{UInt8}),
+        ccall((:TkWinReleaseDrawableDC,libtk), Cvoid, (Int, Int, Ptr{UInt8}),
             drawable, hdc, state)
         return
     end
@@ -459,41 +464,41 @@ const tk_version = convert(VersionNumber,tcl_eval("return \$tk_version"))
 tcl_eval("wm withdraw .")
 
 if tk_version >= v"8.4-" && tk_version < v"8.7-"
-jl_tkwin_display(tkwin::Ptr{Void}) = unsafe_load(convert(Ptr{Ptr{Void}},tkwin), 1) # 8.4, 8.5, 8.6
-jl_tkwin_visual(tkwin::Ptr{Void}) = unsafe_load(convert(Ptr{Ptr{Void}},tkwin), 4) # 8.4, 8.5, 8.6
-jl_tkwin_id(tkwin::Ptr{Void}) = unsafe_load(convert(Ptr{Int},tkwin), 6) # 8.4, 8.5, 8.6
-if is_apple()
+jl_tkwin_display(tkwin::Ptr{Cvoid}) = unsafe_load(convert(Ptr{Ptr{Cvoid}},tkwin), 1) # 8.4, 8.5, 8.6
+jl_tkwin_visual(tkwin::Ptr{Cvoid}) = unsafe_load(convert(Ptr{Ptr{Cvoid}},tkwin), 4) # 8.4, 8.5, 8.6
+jl_tkwin_id(tkwin::Ptr{Cvoid}) = unsafe_load(convert(Ptr{Int},tkwin), 6) # 8.4, 8.5, 8.6
+if Compat.Sys.isapple()
 if tk_version >= v"8.5-"
-    immutable TkWindowPrivate
-        winPtr::Ptr{Void}
-        view::Ptr{Void}
-        context::Ptr{Void}
+    struct TkWindowPrivate
+        winPtr::Ptr{Cvoid}
+        view::Ptr{Cvoid}
+        context::Ptr{Cvoid}
         xOff::Cint
         yOff::Cint
         sizeX::CGFloat;
         sizeY::CGFloat;
-        visRgn::Ptr{Void}
-        aboveVisRgn::Ptr{Void}
-        drawRgn::Ptr{Void}
-        referenceCount::Ptr{Void}
-        toplevel::Ptr{Void}
+        visRgn::Ptr{Cvoid}
+        aboveVisRgn::Ptr{Cvoid}
+        drawRgn::Ptr{Cvoid}
+        referenceCount::Ptr{Cvoid}
+        toplevel::Ptr{Cvoid}
         flags::Cint
     end
     else
-    immutable TkWindowPrivate
-        winPtr::Ptr{Void}
-        grafPtr::Ptr{Void}
-        view::Ptr{Void}
-        context::Ptr{Void}
+    struct TkWindowPrivate
+        winPtr::Ptr{Cvoid}
+        grafPtr::Ptr{Cvoid}
+        view::Ptr{Cvoid}
+        context::Ptr{Cvoid}
         xOff::Cint
         yOff::Cint
         sizeX::CGFloat;
         sizeY::CGFloat;
-        visRgn::Ptr{Void}
-        aboveVisRgn::Ptr{Void}
-        drawRgn::Ptr{Void}
-        referenceCount::Ptr{Void}
-        toplevel::Ptr{Void}
+        visRgn::Ptr{Cvoid}
+        aboveVisRgn::Ptr{Cvoid}
+        drawRgn::Ptr{Cvoid}
+        referenceCount::Ptr{Cvoid}
+        toplevel::Ptr{Cvoid}
         flags::Cint
     end
     end
diff --git a/src/types.jl b/src/types.jl
index 36c0608..67cf9ed 100644
--- a/src/types.jl
+++ b/src/types.jl
@@ -1,15 +1,15 @@
 ## Abstract types
-@compat abstract type Tk_Widget end
-@compat abstract type TTk_Widget <: Tk_Widget end ## for ttk::widgets
-@compat abstract type TTk_Container <: Tk_Widget end ## for containers (frame, labelframe, ???)
+abstract type Tk_Widget end
+abstract type TTk_Widget <: Tk_Widget end ## for ttk::widgets
+abstract type TTk_Container <: Tk_Widget end ## for containers (frame, labelframe, ???)
 
 const Widget = Union{TkWidget, Tk_Widget, Canvas, AbstractString}
 
 ## Maybe -- can this be parameterized?
 ## https://groups.google.com/forum/?fromgroups=#!topic/julia-dev/IbbWwplrqlc (takeaway -- this style is frowned upon)
-const MaybeFunction = Union{Function, Void}
-const MaybeString = Union{AbstractString, Void}
-const MaybeStringInteger = Union{AbstractString, Integer, Void} # for at in tree insert
-const MaybeVector = Union{Vector, Void}
-const MaybeWidget = Union{Widget, Void}
-const MaybeBool = Union{Bool, Void}
+const MaybeFunction = Union{Function, Nothing}
+const MaybeString = Union{AbstractString, Nothing}
+const MaybeStringInteger = Union{AbstractString, Integer, Nothing} # for at in tree insert
+const MaybeVector = Union{Vector, Nothing}
+const MaybeWidget = Union{Widget, Nothing}
+const MaybeBool = Union{Bool, Nothing}
diff --git a/test/runtests.jl b/test/runtests.jl
index b71bbb4..42bc7e1 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -1,6 +1,7 @@
 ## Tests
 using Tk
-using Base.Test
+using Compat
+using Compat.Test
 
 @testset "Toplevel" begin
     w = Toplevel("Toplevel", 400, 400)

From 02d07d28bef993263b50f6ae01189469e68b4665 Mon Sep 17 00:00:00 2001
From: Alex Arslan <ararslan@comcast.net>
Date: Wed, 4 Apr 2018 11:09:26 -0700
Subject: [PATCH 2/6] Bump Compat, work around 0.7 ccall error

---
 REQUIRE         | 2 +-
 src/tkwidget.jl | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/REQUIRE b/REQUIRE
index 721e80b..c1e4764 100644
--- a/REQUIRE
+++ b/REQUIRE
@@ -1,5 +1,5 @@
 julia 0.6
-Compat 0.48.0
+Compat 0.52.0
 Cairo
 Graphics 0.1
 BinDeps 0.2.2-
diff --git a/src/tkwidget.jl b/src/tkwidget.jl
index 735cd7d..baa802d 100644
--- a/src/tkwidget.jl
+++ b/src/tkwidget.jl
@@ -35,7 +35,14 @@ function init()
     end
     ccall((:Tcl_FindExecutable,libtcl), Cvoid, (Ptr{UInt8},),
           joinpath(Compat.Sys.BINDIR, "julia"))
-    ccall((:g_type_init,Cairo._jl_libgobject),Cvoid,())
+
+    # FIXME: On Julia 0.7, the ccall((f, lib), ...) style call errors, claiming that the
+    # (f, lib) tuple isn't a valid constant expression. This approach works around that
+    # by getting a pointer to the function, then passing that to ccall.
+    g_type_init_ptr = Libdl.dlsym(Cairo._jl_libgobject, :g_type_init)
+    ccall(g_type_init_ptr, Cvoid, ())
+    Libdl.dlclose(g_type_init_ptr)
+
     tclinterp = ccall((:Tcl_CreateInterp,libtcl), Ptr{Cvoid}, ())
     @static if Compat.Sys.iswindows()
         htcl = ccall((:GetModuleHandleA,:kernel32),stdcall,Csize_t,

From 00433c3539f49dcd2ca8b3303c828bb5a55b6db3 Mon Sep 17 00:00:00 2001
From: Alex Arslan <ararslan@comcast.net>
Date: Wed, 4 Apr 2018 11:18:30 -0700
Subject: [PATCH 3/6] Whoops

---
 src/tkwidget.jl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/tkwidget.jl b/src/tkwidget.jl
index baa802d..f02f246 100644
--- a/src/tkwidget.jl
+++ b/src/tkwidget.jl
@@ -39,9 +39,11 @@ function init()
     # FIXME: On Julia 0.7, the ccall((f, lib), ...) style call errors, claiming that the
     # (f, lib) tuple isn't a valid constant expression. This approach works around that
     # by getting a pointer to the function, then passing that to ccall.
-    g_type_init_ptr = Libdl.dlsym(Cairo._jl_libgobject, :g_type_init)
+    jl_libgobject_ptr = Libdl.dlopen(Cairo._jl_libgobject)
+    g_type_init_ptr = Libdl.dlsym(jl_libgobject_ptr, :g_type_init)
     ccall(g_type_init_ptr, Cvoid, ())
     Libdl.dlclose(g_type_init_ptr)
+    Libdl.dlclose(jl_libgobject_ptr)
 
     tclinterp = ccall((:Tcl_CreateInterp,libtcl), Ptr{Cvoid}, ())
     @static if Compat.Sys.iswindows()

From 421d1201a768328170837bff994ab896b2dad275 Mon Sep 17 00:00:00 2001
From: Alex Arslan <ararslan@comcast.net>
Date: Fri, 15 Jun 2018 12:37:43 -0700
Subject: [PATCH 4/6] Reinstate simply ccall to Cairo._jl_libgobject

This was an issue in Julia itself and has been fixed upstream.
---
 src/tkwidget.jl | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/tkwidget.jl b/src/tkwidget.jl
index f02f246..735cd7d 100644
--- a/src/tkwidget.jl
+++ b/src/tkwidget.jl
@@ -35,16 +35,7 @@ function init()
     end
     ccall((:Tcl_FindExecutable,libtcl), Cvoid, (Ptr{UInt8},),
           joinpath(Compat.Sys.BINDIR, "julia"))
-
-    # FIXME: On Julia 0.7, the ccall((f, lib), ...) style call errors, claiming that the
-    # (f, lib) tuple isn't a valid constant expression. This approach works around that
-    # by getting a pointer to the function, then passing that to ccall.
-    jl_libgobject_ptr = Libdl.dlopen(Cairo._jl_libgobject)
-    g_type_init_ptr = Libdl.dlsym(jl_libgobject_ptr, :g_type_init)
-    ccall(g_type_init_ptr, Cvoid, ())
-    Libdl.dlclose(g_type_init_ptr)
-    Libdl.dlclose(jl_libgobject_ptr)
-
+    ccall((:g_type_init,Cairo._jl_libgobject),Cvoid,())
     tclinterp = ccall((:Tcl_CreateInterp,libtcl), Ptr{Cvoid}, ())
     @static if Compat.Sys.iswindows()
         htcl = ccall((:GetModuleHandleA,:kernel32),stdcall,Csize_t,

From 77de46890a85e5d7bb50b0342145a62e8c586663 Mon Sep 17 00:00:00 2001
From: Alex Arslan <ararslan@comcast.net>
Date: Thu, 6 Sep 2018 22:40:26 -0700
Subject: [PATCH 5/6] Modify Travis setup to see where we're at

---
 .travis.yml | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 60d9c19..a16b328 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,20 +1,18 @@
 language: julia
 os:
-    - linux
-    - osx
+  - linux
+  - osx
 julia:
-    - 0.6
-    - nightly
+  - 0.6
+  - 0.7
+  - 1.0
+  - nightly
 notifications:
-    email: false
-script:
-    - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
-    - julia -e 'Pkg.clone(pwd())'
-    - if [ `uname` = "Linux" ]; then
-        xvfb-run julia -e 'Pkg.build("Tk"); Pkg.test("Tk"; coverage=true)';
-      elif [ `uname` = "Darwin" ]; then
-        julia -e 'Pkg.build("Tk"); Pkg.test("Tk"; coverage=true)';
-      fi
-    # - xvfb-run julia -e 'Pkg.clone(pwd()); Pkg.build("Tk"); Pkg.test("Tk"; coverage=true)';
+  email: false
+allow_failures:
+  julia:
+    - nightly
+before_script:
+  - if [ $(uname) = "Linux" ]; then alias julia="xvfb-run $(which julia)"; fi
 after_success:
-    - julia -e 'cd(Pkg.dir("Tk")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())';
+  - julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())';

From 1333be7ed97e4064b3278302df9720576fc84736 Mon Sep 17 00:00:00 2001
From: Alex Arslan <ararslan@comcast.net>
Date: Thu, 6 Sep 2018 22:51:29 -0700
Subject: [PATCH 6/6] The previous commit, but better

---
 .travis.yml | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index a16b328..fb51a49 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,10 +9,19 @@ julia:
   - nightly
 notifications:
   email: false
-allow_failures:
-  julia:
-    - nightly
-before_script:
-  - if [ $(uname) = "Linux" ]; then alias julia="xvfb-run $(which julia)"; fi
+matrix:
+  allow_failures:
+    julia:
+      - 1.0
+      - nightly
+script:
+  - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
+  - julia -e 'using Pkg; Pkg.clone(pwd())'
+  - |
+      if [ $(uname) = "Linux" ]; then
+        xvfb-run julia -e 'using Pkg; Pkg.build("Tk"); Pkg.test("Tk", coverage=true)'
+      else
+        julia -e 'using Pkg; Pkg.build("Tk"); Pkg.test("Tk", coverage=true)'
+      fi
 after_success:
   - julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())';