[Haskell-cafe] Problem getting started with graphics library in GHC on Windows

Tomi Maila Tomi.Maila at helsinki.fi
Sat Aug 19 12:03:53 EDT 2006


Hi,

I'm a Haskell newbie. I've been studying Haskell by reading the book The
Haskell School of Expression. Most of the example in the book use
graphics library SOEGraphics. Windows GHC didn't find the library, but I
assumed that the new name for the library is Graphics.SOE which seemed
to properly loaded.

The problem is that I fail to get the Graphics library to work properly.
Instead GHC freezes if I use the graphics library in interactive mode
and if I compile into a binary the binary freezes. The problem is not
only with Graphics.SOE but also with more general Graphics.HGL.

If I execute the Hello World program presented in Graphics.HGL
documentation front page,  GHC interactive mode freezes after opening
the window  but before drawing any text on the window.  Compiled binary
never even opens a window but freezes before that. Examples in HSOE (the
book) behave the exactly the same way. I get not error messages what so
ever. The example I refer to above is below.

 module Main where

 import Graphics.HGL

 main :: IO ()
 main = runGraphics $
	withWindow_ "Hello World Window" (300, 200) $ \ w -> do
	drawInWindow w $ text (100, 100) "Hello World"
	drawInWindow w $ ellipse (100, 80) (200, 180)
	getKey w


 
The question is what I could be doing wrong or is Graphics library just
incompatible with my environment. I'm using GHC 6.4.2 on Windows XP SP2.
I've been developing using Eclipse 3.2 with EclipseFP plugin. However
I've also tried to compile on command line. Could somebody help me over
(no I'm not moving to Linux...)

Cheers,

Tomi

-- 
Tomi Maila
Research scientist

Bio- ja ympäristötieteiden laitos	Department of Biological 
Biotieteellinen tiedekunta		and Environmental Sciences
PL 65 (Viikinkaari 1)			P.O. Box 65 (Viikinkaari 1)
00014 HELSINGIN YLIOPISTO		00014 UNIVERSITY OF HELSINKI
puhelin (09) 191 59837			tel. +358-9-191 59837
matkapuh. 040 554 9024			mobile. +358-40-554 9024
					
http://www.helsinki.fi/~tmaila/		




More information about the Haskell-Cafe mailing list