Ticket #1212: test.hs

File test.hs, 483 bytes (added by guest, 3 years ago)

Buggy Haskell Version

Line 
1import Graphics.UI.Gtk
2import Control.Monad.Trans (liftIO)
3import Text.Printf
4
5main = do
6    initGUI
7    window <- windowNew
8--  on window deleteEvent (liftIO (printf "Test") >> return True) -- Works?
9    on window deleteEvent (liftIO mainQuit >> return False)
10
11    button <- buttonNewWithLabel "Test"
12    on button buttonActivated (printf "Test") -- Fails
13--  on button buttonActivated (putStrLn "Test") -- Works
14
15    containerAdd window button
16    widgetShowAll window
17    mainGUI