timbod7 / haskell-chart

A 2D charting library for haskell
430 stars 85 forks source link

Add haskell-gi/gi-gtk backend #252

Open ribosomerocker opened 1 year ago

ribosomerocker commented 1 year ago

GTK2 has unfortunately been long abandoned, and gtk2 windows look very out of place. Even programs like GIMP have migrated off of it. And the package we use for the GTK3 backend has incomplete bindings. Here's what the package itself says:

For all new application development you should consider using haskell-gi as it has much more complete bindings. Cairo and WebKitGTK JavaScriptCore do not have GObject introspection data so you will still need to use the Gtk2Hs packages for those (even when using haskell-gi for everything else).

GTK4 has also been released, and only haskell-gi/gi-gtk has support for it. It will be viable to add such a backend, and maybe even deprecate the other ones in the future, because gi-gtk's interface for gtk3 is much better, and as i said before, gtk2 has long been deprecated and abandoned.

Furthermore, after this addition, it would also be helpful to add documentation in the wiki about the gtk backends for interactive plot creation.

Related to #241

timbod7 commented 1 year ago

There are currently 2 backends for GTK:

chart-gtk is the original one that I wrote chart-gtk2 was a submitted PR back in 2018

Both of these are just small adaptors to get a cairo context in an gtk environment (each approx 100 lines).

I'd be happy to receive a PR for a modern gtk environment.