[Haskell-cafe] Can't get Regions to show up in HGL

Brandon Simmons brandon.m.simmons at gmail.com
Sat Mar 13 21:02:43 EST 2010

I'm having trouble finding example code that uses Regions in the
Haskell Graphics Library. But the following gives me a black window
when I think it should give me a black window with a square in it:

------------------ START CODE ------------------------------------------

import Graphics.HGL

main = runGraphics test

test = do
    w <- openWindow "Test" (100,100)
    drawInWindow w $ withRGB (RGB 255 255 255) testRegion
    getLBP w
    closeWindow w

testRegion = regionToGraphic $ rectangleRegion (5,5) (30,30)

------------------ END CODE ------------------------------------------

Am I using it correctly? If I am, then any other help is greatly appreciated.

I am on Debian Squeeze using GHC 6.12.1 (thanks debian maintainers!),
and using HGL-

Brandon Simmons

More information about the Haskell-Cafe mailing list