gcNew with simple draw example haskell gtk

I am trying to draw a simple pixel with gtk/haskell. This is the code, but I get an error. GHC 6.12.3? with the most recent gtk library. Error: # ghc --make SimpleCells.hs [1 of 1] Compiling Main ( SimpleCells.hs, SimpleCells.o ) Graphics\UI\Gtk\Misc\DrawingArea.chs:22:10: Not in scope: `gcNew' ----- import Graphics.UI.Gtk renderScene d ev = do dw <- widgetGetDrawWindow d (w,h) <- widgetGetSize d gc <- gcNew dw return True main = do initGUI window <- windowNew drawing <- drawingAreaNew onExpose drawing (renderScene drawing) window `onDestroy` mainQuit windowSetDefaultSize window 800 600 windowSetPosition window WinPosCenter widgetShowAll window mainGUI -- Berlin Brown (berlin dot brown at gmail.com) http://botnode.com http://berlinbrowndev.blogspot.com/

try: import Graphics.UI.Gtk.Gdk.GC
If you can't find a function, try searching on hayoo (at hackage.haskell.org).
On Sat, Mar 12, 2011 at 3:37 PM, Berlin Brown
I am trying to draw a simple pixel with gtk/haskell. This is the code, but I get an error. GHC 6.12.3? with the most recent gtk library. Error: # ghc --make SimpleCells.hs [1 of 1] Compiling Main ( SimpleCells.hs, SimpleCells.o ) Graphics\UI\Gtk\Misc\DrawingArea.chs:22:10: Not in scope: `gcNew'
----- import Graphics.UI.Gtk renderScene d ev = do dw <- widgetGetDrawWindow d (w,h) <- widgetGetSize d gc <- gcNew dw return True main = do initGUI window <- windowNew drawing <- drawingAreaNew onExpose drawing (renderScene drawing) window `onDestroy` mainQuit windowSetDefaultSize window 800 600 windowSetPosition window WinPosCenter widgetShowAll window mainGUI -- Berlin Brown (berlin dot brown at gmail.com) http://botnode.com http://berlinbrowndev.blogspot.com/
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (2)
-
Berlin Brown
-
David McBride