
I propose a simple program which pops up a window saying 'Hello World' with a button saying 'Bye' which you click and it changes the message to 'Goodbye'. if you click the button again the program exits.
Good plan, John! Here is my contribution for the GIO library. All the best, Daan. ps. more examples are in the cvs. (http://htoolkit.sourceforge.net) --------------------------------------------------------------------------------{--------------------------------------------------------------------------------This program implements the "goodbye" demo as posted by John Meacham onthe Haskell GUI mailing list. Note that this demo also uses a nice layout: the label and button are centeredin the window with some padding around it. When the button is clicked thefirst time, it calls "bye". This function changes the text of the labeland installs another event handler on the button, that closes the main window.(by default, GIO exits the gui when all windows are closed).--------------------------------------------------------------------------------}module Main whereimport Graphics.UI.GIOmain = start demo -- "start" initializes the GUI. demo :: IO ()demo = do w <- window [title =: "Bye!"] l <- label [text =: "Hello World"] w b <- button [text =: "Bye"] w set w [layout =: pad 10 (center l ^^^^ center b)] set b [on command =: bye w l b] where -- called on the first click, with the window, label, and button as arguments. bye w l b = do set l [text =: "Goodbye"] set b [on command =: close w]