
I took a few minutes (5) to implement the Haskell GUI example in HTk. Code attached. Forgive me for boasting but it seems clearer, simpler and shorter than any other of the examples codings on John Meacham's website. The closest competitor seems to be GIO. This code should work (I haven't tested it) on any of Windows, Linux, Solaris and FreeBSD, all of which we support. {- "Goodbye" demo as discussed on the Haskell mailing list. Specification: pops up a window saying "Hello World" and presenting a button saying "Bye". Clicking the button once changes the message to "Goodbye"; clicking it a second time causes the program to quit. -} module Main where import Computation import Events import HTk main = do mainWin <- initHTk [text "Hello World"] label <- newLabel mainWin [text "Hello World"] button <- newButton mainWin [text "Bye"] pack label [] pack button [] buttonClicked <- clicked button sync buttonClicked label # text "Goodbye" sync buttonClicked destroy mainWin