is gldrawingarea an instance of widgetclass

I get this : No instance for (Gtk.WidgetClass GtkGL.GLDrawingArea) arising from a use of `Gtk.boxPackStart' in code that was compiling at one point. This is how I'm importing import qualified Graphics.UI.Gtk.OpenGL as GtkGL then glCanvas <- GtkGL.glDrawingAreaNew glconfig and use it thusly: Gtk.boxPackStart hBox1 glCanvas Gtk.PackNatural 0 boxPackStart wants something WidgetClass, and GLDrawingArea seems to be an instance of widget class. The gtkglext hasn't been touched in quite a while. I'm wondering if it's become out of date with the latest gtk. ?? Thanks, Brian

On Tue, 2014-12-23 at 23:03 -0800, briand@aracnet.com wrote:
I get this :
No instance for (Gtk.WidgetClass GtkGL.GLDrawingArea) arising from a use of `Gtk.boxPackStart'
in code that was compiling at one point. This is how I'm importing
import qualified Graphics.UI.Gtk.OpenGL as GtkGL
Is your code cabalized? If not, then probably you indirectly depend on different versions of gtk. For example, GLDrawingArea is instance of WidgetClass from one version of gtk, but you need the instance from other version of gtk. Check `ghc-pkg list gtk`. There is a number of related questions on SO, e.g. http://stackoverflow.com/questions/27301221/haskell-http-client-using-bytest... Thanks, Yuras
then
glCanvas <- GtkGL.glDrawingAreaNew glconfig
and use it thusly:
Gtk.boxPackStart hBox1 glCanvas Gtk.PackNatural 0
boxPackStart wants something WidgetClass, and GLDrawingArea seems to be an instance of widget class.
The gtkglext hasn't been touched in quite a while. I'm wondering if it's become out of date with the latest gtk.
??
Thanks,
Brian
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Wed, 24 Dec 2014 11:46:35 +0300
Yuras Shumovich
On Tue, 2014-12-23 at 23:03 -0800, briand@aracnet.com wrote:
I get this :
No instance for (Gtk.WidgetClass GtkGL.GLDrawingArea) arising from a use of `Gtk.boxPackStart'
in code that was compiling at one point. This is how I'm importing
import qualified Graphics.UI.Gtk.OpenGL as GtkGL
Is your code cabalized? If not, then probably you indirectly depend on different versions of gtk. For example, GLDrawingArea is instance of WidgetClass from one version of gtk, but you need the instance from other version of gtk. Check `ghc-pkg list gtk`.
ah. ok. i bet this is due to the fact that i'm using the debian install of ghc and a locally upgraded cabal. i've never been able to get the debian ghc and cabal to coexist happily. i always end up purging it and compiling my own local ghc. Looks like i'm back to doing that. Brian
participants (2)
-
briand@aracnet.com
-
Yuras Shumovich