RSS

gtk2hs - timeout

timeoutAddで定期処理のテスト

module Main where
import Control.Monad.Trans(liftIO)

import Graphics.UI.Gtk

main = do
    initGUI
    window <- windowNew
    windowSetDefaultSize window 640 400
    on window deleteEvent (liftIO $ do 
                              mainQuit
                              return False)
    widgetShowAll window
    timeoutAdd (putStrLn "Hello" >> return True) 1000
    mainGUI