Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #285 from tkelman/tk/versions
Browse files Browse the repository at this point in the history
Use isdefined and Compat instead of unspecific VERSION conditions
  • Loading branch information
timholy authored Feb 23, 2017
2 parents 6b7056d + dea56d8 commit c8cb239
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Graphics 0.1
BinDeps
@windows WinRPM
@osx Homebrew
Compat 0.8.0
Compat 0.9.5
BaseTestNext
2 changes: 1 addition & 1 deletion src/GLib/glist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ strides(list::LList) = (1,)
stride(list::LList, k::Integer) = (k > 1 ? length(list) : 1)
size(list::LList) = (length(list),)
isempty{L}(list::LList{L}) = (unsafe_convert(Ptr{L}, list) == C_NULL)
if VERSION > v"0.6.0-"
if isdefined(Base, :iteratorsize)
Base.iteratorsize{L <: LList}(::Type{L}) = Base.HasLength()
end

Expand Down
10 changes: 2 additions & 8 deletions test/gui.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
using Gtk.ShortNames, Gtk.GConstants, Gtk.Graphics
import Gtk.deleteat!, Gtk.libgtk_version, Gtk.GtkToolbarStyle, Gtk.GtkFileChooserAction, Gtk.GtkResponseType
using Compat
if VERSION < v"0.6.0-"
take!(b::IOBuffer) = takebuf_array(b)
if VERSION < v"0.5.0-"
const String = Base.UTF8String
end
end

## for FileFilter
# This is just for testing, and be careful of garbage collection while using this
Expand Down Expand Up @@ -721,13 +715,13 @@ signal_emit(c, "button-press-event", Bool, press2)
pop!((c.mouse,:button1press))
signal_emit(c, "button-press-event", Bool, press1)
signal_emit(c, "button-press-event", Bool, press2)
str = String(take!(io))
str = Compat.String(take!(io))
@test str == "cb1_1\ncb2_1\ncb1_2\ncb2_1\ncb1_2\ncb2_2\ncb1_1\ncb2_2\n"

c.mouse.scroll = (widget,event) -> println(io, "scrolling")
scroll = Gtk.GdkEventScroll(Gtk.GdkEventType.SCROLL, Gtk.gdk_window(c), Int8(0), UInt32(0), 0.0, 0.0, UInt32(0), Gtk.GdkScrollDirection.UP, convert(Ptr{Float64},C_NULL), 0.0, 0.0, 0.0, 0.0)
signal_emit(c, "scroll-event", Bool, scroll)
str = String(take!(io))
str = Compat.String(take!(io))
@test str == "scrolling\n"

destroy(w)
Expand Down

0 comments on commit c8cb239

Please sign in to comment.