b.i.mills@massey.ac.nz wrote:
Also ... I've been using the graphics libs with HUGS, but I can't find the equivalent in GHC ... what is the recomended library for writing GUIs in GHC Haskell? And where do I get it?
My current favourite way to make GUI's is to use the GUI painter Glade and have it generate C code with calls to the Gtk GUI library, after that the only thing you have to implement are the callbacks. One big advantage Gtk offers over other GUI libraries is that it clearly separates the GUI construction code from the callback code, this makes it very suitable for GUI painters, i.e. the code the GUI painter generates doesn't have to be changed manually. Another advantage of Gtk, from the Haskell viewpoint, is that it was designed to work with other languages. Quoted from the Gtk page: GTK+ has been designed from the ground up to support a range of languages, not only C/C++. Using GTK+ from languages such as Perl and Python (especially in combination with the Glade GUI builder) provides an effective method of rapid application development. Although I haven't looked at the Haskell side in a while, everything to go from Glade to a Haskell GUI should all be there: http://www.gtk.org/ http://glade.gnome.org/ http://www.cse.unsw.edu.au/~chak/haskell/gtk/ The most recent version of Gtk+HS has support for libglade, this means you can directly read the Glade XML file that describes the GUI construction and the names of the callback functions. To be honest I don't know how the callbacks are actually connected to Haskell code, but there is probably an example in the Gtk+HS distribution to show how it works. Jan