[Haskell-beginners] gcNew with simple draw example haskell gtk
David McBride
dmcbride at neondsl.com
Sat Mar 12 22:40:54 CET 2011
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 <berlin.brown at gmail.com> wrote:
> 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 at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
More information about the Beginners
mailing list