Skip to content

Commit c44f11b

Browse files
authored
Merge pull request JuliaGraphics#127 from bjarthur/deprecations
fix julia 0.5 deprecations
2 parents 69ab458 + ba8f41b commit c44f11b

File tree

8 files changed

+18
-19
lines changed

8 files changed

+18
-19
lines changed

.travis.yml

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ language: julia
22
os:
33
- linux
44
julia:
5-
- 0.3
65
- 0.4
76
- 0.5
87
- nightly

REQUIRE

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
julia 0.3
2-
Compat 0.7.16
1+
julia 0.4
2+
Compat 0.7.20
33
Cairo
44
Graphics 0.1
55
BinDeps 0.2.2-

deps/build.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ using Compat; import Compat.String
55

66
tcl = library_dependency("tcl",aliases=["libtcl8.6","tcl86g","tcl86t","libtcl","libtcl8.6.so.0","libtcl8.5","libtcl8.5.so.0","tcl85"])
77
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)
8-
@osx_only return @compat Libdl.dlsym_e(h,:TkMacOSXGetRootControl) != C_NULL
8+
is_apple() && (return @compat Libdl.dlsym_e(h,:TkMacOSXGetRootControl) != C_NULL)
99
return true
1010
end)
1111

12-
@windows_only begin
12+
if is_windows()
1313
using WinRPM
1414
provides(WinRPM.RPM,"tk",tk,os = :Windows)
1515
provides(WinRPM.RPM,"tcl",tcl,os = :Windows)
@@ -21,12 +21,12 @@ provides(AptGet,"tk8.5",tk)
2121
provides(Sources,URI("http://prdownloads.sourceforge.net/tcl/tcl8.6.0-src.tar.gz"),tcl,unpacked_dir = "tcl8.6.0")
2222
provides(Sources,URI("http://prdownloads.sourceforge.net/tcl/tk8.6.0-src.tar.gz"),tk,unpacked_dir = "tk8.6.0")
2323

24-
is64bit = WORD_SIZE == 64
24+
is64bit = @compat Sys.WORD_SIZE == 64
2525

2626
provides(BuildProcess,Autotools(configure_subdir = "unix", configure_options = [is64bit?"--enable-64bit":"--disable-64bit"]),tcl, os = :Unix)
2727
provides(BuildProcess,Autotools(configure_subdir = "unix", configure_options = [is64bit?"--enable-64bit":"--disable-64bit"]),tk, os = :Unix)
2828

29-
if WORD_SIZE == 64
29+
if @compat Sys.WORD_SIZE == 64
3030
# Unfortunately the mingw-built tc segfaults since some function signatures
3131
# are different between VC and mingw. This is fixed on tcl trunk. For now,
3232
# just use VC to build tcl (Note requlres Visual Studio Express in the PATH)

examples/manipulate.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function manipulate(ex::(@compat Union{Symbol,Expr}), controls...)
136136

137137
function dict_to_module(d::Dict) ## stuff values into Manipulate Context
138138
for (k,v) in d
139-
eval(ManipulateContext, :($(symbol(k)) = $v))
139+
eval(ManipulateContext, :($(Symbol(k)) = $v))
140140
end
141141
end
142142

@@ -165,8 +165,8 @@ ex = quote
165165
s = sin(x)
166166
p = FramedPlot()
167167
setattr(p, "title", title)
168-
if
169-
fillbetween add(p, FillBetween(x, c, x, s) )
168+
if fillbetween
169+
add(p, FillBetween(x, c, x, s) )
170170
end
171171
add(p, Curve(x, c, "color", color) )
172172
add(p, Curve(x, s, "color", "blue") )

examples/workspace.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function update_ids(m::Module)
2020
global __ids__
2121
nms = get_names(m)
2222
nms = filter(u -> u != "__ids__", nms)
23-
a_ids = map(u -> unique_id(symbol(u), m), nms)
23+
a_ids = map(u -> unique_id(Symbol(u), m), nms)
2424
if __ids__ == a_ids
2525
false
2626
else
@@ -47,9 +47,9 @@ function get_names_summaries(m::Module, pat::MaybeRegex, dtype::MaybeType, dtype
4747
end
4848
## filter out this type
4949
if dtype != nothing
50-
nms = filter(u -> isdefined(m, symbol(u)) && negate(isa(eval(m,symbol(u)), dtype), dtypefilter), nms)
50+
nms = filter(u -> isdefined(m, Symbol(u)) && negate(isa(eval(m,Symbol(u)), dtype), dtypefilter), nms)
5151
end
52-
summaries = map(u -> isdefined(m, symbol(u)) ? short_summary(eval(m,symbol(u))) : "undefined", nms)
52+
summaries = map(u -> isdefined(m, Symbol(u)) ? short_summary(eval(m,Symbol(u))) : "undefined", nms)
5353

5454
if length(nms) == length(summaries)
5555
return [nms summaries]
@@ -75,7 +75,7 @@ scrollbars_add(f, tv)
7575
## add a callback. Here we get the obj clicked on.
7676
callback_add(tv, (path) -> begin
7777
val = get_value(tv)[1]
78-
obj = eval(Main, symbol(val))
78+
obj = eval(Main, Symbol(val))
7979
println(short_summary(obj))
8080
end)
8181

src/core.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function bindwheel(widget::Widget, modifier::AbstractString, callback::Function,
201201
tkargs = string(" ", tkargs)
202202
end
203203
ccb = tcl_callback(callback)
204-
if OS_NAME == :Linux
204+
if is_linux()
205205
tcl_eval("bind $(path) <$(modifier)Button-4> {$ccb -120$tkargs}")
206206
tcl_eval("bind $(path) <$(modifier)Button-5> {$ccb 120$tkargs}")
207207
else
@@ -229,7 +229,7 @@ function callback_add(widget::Tk_Widget, callback::Function)
229229
:Tk_Text => "<FocusOut>",
230230
:Tk_Treeview => "<<TreeviewSelect>>"
231231
)
232-
key = Base.symbol(split(string(typeof(widget)), '.')[end])
232+
key = Base.Symbol(split(string(typeof(widget)), '.')[end])
233233
if haskey(events, key)
234234
event = events[key]
235235
if event == nothing

src/menu.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function menu_add(widget::Tk_Menu, rb::Tk_Radio)
5454
end
5555

5656
function tk_popup(widget::Tk_Widget, menu::Tk_Menu)
57-
if OS_NAME == :Darwin
57+
if is_apple()
5858
tcl_eval("bind $(widget.w.path) <2> {tk_popup $(menu.w.path) %X %Y}")
5959
tcl_eval("bind $(widget.w.path) <Control-1> {tk_popup $(menu.w.path) %X %Y}")
6060
else
@@ -63,7 +63,7 @@ function tk_popup(widget::Tk_Widget, menu::Tk_Menu)
6363
end
6464

6565
function tk_popup(c::Canvas, menu::Tk_Menu)
66-
if OS_NAME == :Darwin
66+
if is_apple()
6767
tcl_eval("bind $(c.c.path) <2> {tk_popup $(menu.w.path) %X %Y}")
6868
tcl_eval("bind $(c.c.path) <Control-1> {tk_popup $(menu.w.path) %X %Y}")
6969
else

src/tkwidget.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ function reveal(c::Canvas)
266266
end
267267

268268
@static if is_apple()
269-
if WORD_SIZE == 32
269+
if @compat Sys.WORD_SIZE == 32
270270
typealias CGFloat Float32
271271
else
272272
typealias CGFloat Float64

0 commit comments

Comments
 (0)