JuliaGraphics / Winston.jl

2D plotting for Julia
MIT License
171 stars 55 forks source link

fix deprecation warn #279

Closed floriangriese closed 7 years ago

floriangriese commented 7 years ago

@Gtk.GtkWindow is deprecated, use Gtk.GtkWindow instead.

ararslan commented 7 years ago

Hey @flo12345678, thanks for the contribution! Do you know what version of Gtk.jl introduced this change and whether the new method is available in previous versions? We just have to make sure we set the Gtk requirement bounds appropriately in REQUIRE.

timholy commented 7 years ago

Maybe 0.11.0?

nolta commented 7 years ago

Should @Canvas be changed too?

timholy commented 7 years ago

Yes, anything Gtk-related with a @ should drop it.

floriangriese commented 7 years ago

How do I find out at which Gtk version it was introduced? Do I have to search the History in Gtk?

ararslan commented 7 years ago

How do I find out at which Gtk version it was introduced?

It's admittedly pretty annoying so I went ahead and did it. The correct version is 0.11.0. For reference, I found the PR that made the change by searching the closed PRs, clicked the SHA of the merge commit, then checked the top, where the GitHub UI tells you the first and most recent tag that contains the commit. In this case it's v0.11.0, so we should change the Gtk line in REQUIRE to be Gtk 0.11.0. If you could make that change, that would be fantastic!

nolta commented 7 years ago

Slightly off-topic, but does Gtk even work anymore?

$ WINSTON_OUTPUT=gtk ./julia -q
julia> VERSION
v"0.6.1-pre.0"

julia> using Winston

julia> Winston.output_surface
:gtk

julia> plot([1,2,3])
Error showing value of type Winston.FramedPlot:
ERROR: closures are not yet c-callable
nolta commented 7 years ago

I'm not keen on requiring both Tk and Gtk.

ararslan commented 7 years ago

I didn't realize Gtk wasn't a preexisting requirement. Why is there anything related to Gtk in here, then?

nolta commented 7 years ago

It's optional, you can use it instead of Tk. Ideally we could express that in REQUIRE, something like:

Tk 0.5.2 || Gtk 0.11.0
ararslan commented 7 years ago

Ah yes, the age-old need for explicit optional dependencies. Hopefully in 1.0...

timholy commented 7 years ago

Assuming the bug above is easily fixable, why not just adopt Gtk? It can be precompiled, whereas I think Tk currently cannot, and that's a pretty big advantage. At last check (may not be relevant anymore) it also has considerably higher drawing performance, despite the fact that both are using what should be the same Cairo backend.

tknopp commented 7 years ago

I am using Gtk/Winston and this works very well, so I am all for @timholy suggestion. That Winston can be so easy integrated into Gtk is what makes this package to important to me.

But: Can somewhat hit the merge button (and do a release) since this PR did fix an actual issue and is ready to go.

nolta commented 7 years ago

Ok, ae419c392ed22e9d25e31e6bbfff63e0ec4ee268. Thanks @flo12345678!

tknopp commented 7 years ago

Thanks @nolta. The bug you found is (by the way) also present in Julia 0.5. I just do not encounter it, since I directly embed Winston into a Gtk surface.