[GUI] Re: Gtk and Object I/O

Axel Simon A.Simon@ukc.ac.uk
Fri, 24 Jan 2003 10:06:35 +0000


Hi all,

> 1- Forget about interfacing to Gtk,Qt,MFC,TK,WxWindows or whatever.
>    Instead write the entire thing in Haskell (preferably),
>    C (if necessary) and perhaps even the occasional bit
>    of assembler for stuff that must really fly using
>    MMX,Altivec..
Well, I think this the most extreme approach: Just use "setPixel" and 
"getPixel" to create fancy GUIs. Gtk does exactly this and does it quite 
well.

This "let's do it all ourself" sounds very much like the 
"not-invented-here" syndrome. Please realize that there are libraries out 
there which are free, portable, well maintained and accomplish all that 
what you would like to do from scratch. Gtk is one such example.

Maybe the people who have a binding to offer (Krasimir, Manuel, 
myself,...) should give a quick overview of what they have and what the 
capabilities are.

Here is my binding: gtk2hs

- it has been tested on FreeBSD, Linux, Solaris, MacOSX/XDarwin and Windows

- automatic memory management: your program only crashes via Haskell 
exceptions (or if there is a bug in Gtk)

- 90-95% of all widgets are bound, what is lacking is the binding to 
Drag'n'Drop, Selections, Clipboards, some Font rendering. Custom widgets 
work including the drawing primitives.

- preliminary documentation (no data types, no type hierarchy, no nice 
layout) can be found on
http://www.cs.ukc.ac.uk/people/staff/as49/gtk2hs/

- we hope to have packages available for the next release, especially for 
Windows, since there are a lot of prerequisites and libraries you need

- we use c2hs and hsc2hs to generate the interface automatically - all
functions are guaranteed to be bound correctly

The URL of the project is
http://gtk2hs.sourceforge.net/

Axel.