Closed hol430 closed 3 years ago
It's a been a long time since I used the GTK. I've got as far as getting a netcore2.1 build working with the new nuget package with minimal changes, but I can't get net461 to work. (my branch: https://github.com/VisualMelon/oxyplot-gtksharp/tree/netcore)
Would you be prepared to put a PR together/help with one?
Some notes on the new library:
OnScrollEvent
always seems to say that we are scrolling down with my one dimension mouse wheel; I assume this isn't expected, because it breaks mouse-wheel scrollingYep, I'm happy to help out where I can. The problem with scrolling appears to be due to some changes to the scrolling event generated by gdk3. From the docs:
Some GDK backends can also generate “smooth” scroll events, which can be recognized by the GDK_SCROLL_SMOOTH scroll direction. For these, the scroll deltas can be obtained with gdk_event_get_scroll_deltas().
I've applied a simple fix in bcc70a1. Getting a .net framework build to work is proving somewhat more challenging. I can't seem to build and run the ExampleBrowserGtk3 project even on the master branch, I get a System.DllNotFoundException: 'Unable to load DLL 'libgtk-3-0.dll': The specified module could not be found.
when I try and run, even though I have gtk#(3) installed.
Edit: Just tried on Linux and the ExampleBrowserGtk3 project seems to work for me out of the box, on both net461 and netcoreapp2.1 builds.
Just tried on Linux and the ExampleBrowserGtk3 project seems to work for me out of the box, on both net461 and netcoreapp2.1 builds.
Is that your modified version using the new library with GtkSharp, or a modified version of master
targeting netcore somehow?
Sorry, my comment was a bit ambiguous. I built everything on your netcore branch, which uses the new GtkSharp package, and it ran on both framework (via mono) and netcore on Linux. I don't understand how the framework build worked, because GtkSharp is supposed to be .net core only. Maybe I was working on a dirty branch. I will try and have another look at this tomorrow/later this week.
Ah, so you didn't need to install Gtk separately under linux either?
I'll try to work out why the windows NET Core build of my branch crashes on start up.
The issue with NET Framework (in my branch) is just that GtkSharp isn't signed, and a signed assembly must must load only signed assemblies. Apparently this isn't an issue with NET Core. It's easily resolved by not signing OxyPlot.GtkSharp3 or using a signed version of the GtkSharp package.
The mouse wheel fix is working in both NET Core and NET Framework by the way.
Thanks for following up on this. By using the GtkSharp nuget packages from the recent CI build I am able to run the example browser (on your netcore branch) on windows, under both netcore and framework. I will double check on my linux box later today and update this comment.
wrt the mouse wheel change - I've made another commit which simplifies things somewhat (1c6937ed3c3fe910f215fec6be99a4f73c6bbcd2). At the time of the original commit I assumed for some reason that the code was shared between gtk2/3 which it isn't.
Edit: tested the example browser on Linux, both netcoreapp2.1 and net461 in your netcore branch and it seems to be working. To answer your earlier question, I already had both gtk2 and gtk3 installed separately.
Thanks for testing that again. The \\ untested
comment can probably go now ;)
If you want to put a PR together with your fixes, we can wait a bit to see if there are any objections and perform some more testing (e.g. check the performance of the new library is not significantly worse than the old). I won't be in a rush to merge this; as this isn't a project I've used for 5 or so years.
Just wondering if you guys have any plans to release a .net core version of OxyPlot.GtkSharp3. As far as I can tell - apologies if I've missed something here - this package is currently built for .net framework, using an old-ish version of gtk-sharp-3. I've managed to build a .net core version of OxyPlot.GtkSharp3 (using this repo for gtk#) without much trouble. Would be handy if something like this was on nuget.