Ticket #1212: test.hs
| File test.hs, 483 bytes (added by guest, 2 years ago) |
|---|
| Line | |
|---|---|
| 1 | import Graphics.UI.Gtk |
| 2 | import Control.Monad.Trans (liftIO) |
| 3 | import Text.Printf |
| 4 | |
| 5 | main = 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 |