Skip to content

Commit

Permalink
fail in __init__() with error if Gtk4 was previously imported (preven…
Browse files Browse the repository at this point in the history
…ts a crash)

Also remove redundant tests that I introduced
  • Loading branch information
jwahlstrand committed Jul 28, 2022
1 parent b1e2d5e commit ff298f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Gtk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ include("gio.jl")
include("application.jl")

function __init__()
in(:Gtk4, names(Main, imported=true)) && error("Gtk is incompatible with Gtk4.")

# Set XDG_DATA_DIRS so that Gtk can find its icons and schemas
ENV["XDG_DATA_DIRS"] = join(filter(x -> x !== nothing, [
dirname(adwaita_icons_dir),
Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ include("gui.jl")
include("list.jl")
include("misc.jl")
include("text.jl")
include("tree.jl")

end

0 comments on commit ff298f5

Please sign in to comment.