[Haskell-cafe] HGL window update problem

Rodrigo Queiro overdrigzed at gmail.com
Fri Feb 6 12:58:52 EST 2009


In this program, the HGL window only updates when I mouseover it. Can
someone tell me why this is / how I should avoid it?

Thanks!
Rodrigo

module Main where

import Graphics.HGL

import Control.Concurrent
import Control.Concurrent.MVar
import Control.Monad

main = do
    stringMVar <- newEmptyMVar

    forkIO . runGraphics $ do
        w <- openWindowEx "HGLTest" Nothing (300, 100) DoubleBuffered Nothing

        forever $ do
            string <- takeMVar stringMVar
            setGraphic w $ text (0, 0) string

    forever $ do
        string <- getLine
        putMVar stringMVar string


More information about the Haskell-Cafe mailing list