How to render diagrams in gi-gtk?

179 views Asked by At

I want to render a diagram on top of a GUI written with gi-gtk. I tryed to use the defaultRender function from the Diagrams.Backend.Gtk but the compiler is complaining with :

• Couldn't match expected type ‘gtk-0.15.5:Graphics.UI.Gtk.Types.DrawingArea’
              with actual type ‘Gtk.DrawingArea’
  NB: ‘Gtk.DrawingArea’
        is defined in ‘GI.Gtk.Objects.DrawingArea’
            in package ‘gi-gtk-3.0.36’
      ‘gtk-0.15.5:Graphics.UI.Gtk.Types.DrawingArea’
        is defined in ‘Graphics.UI.Gtk.Types’ in package ‘gtk-0.15.5’
• In the first argument of ‘defaultRender’, namely ‘canvas’

After verifying the Diagrams.Backend.Gtk, I saw that it is builded with the old Graphics.UI.Gtk.Types from GTk2Hs which seems the cause of this error.

Is there a similar module as Diagrams.Backend.Gtk written with the GI.Gtk package ?

Do you know if in the future the diagrams backend will be build with the GI.Gtk package ?

1

There are 1 answers

0
simre On

There is another package diagrams-gi-gtk which probably contains what you are looking for. I have recently updated it to GTK4, so you might want to use my fork until it gets merged.