SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Sponsored Links

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

GTK+ Binding for Haskell -*-text-*-

Gtk+HS is a Haskell binding for the GUI toolkit GTK+. It is currently in the middle of development, but can already be used for average interfaces.

http://www.cse.unsw.edu.au/~chak/haskell/gtk/

Haskell is a state-of-the-art general purpose, purely functional programming language. It combines modern language design and a solid formal foundation with the features required for real-world programming - details are available at

http://haskell.org

Contents

AUTHORS -- Author information COPYING.LIB -- GNU Library General Public License (LGPL) ChangeLog -- Change history INSTALL -- Help on installing this package Makefile -- Root makefile NEWS -- Information on the latest development README -- This file TODO -- Roadmap and known bugs configure.in -- GNU autoconf input configure -- Automatic configuration file created by GNU autoconf examples -- Some example code using the library ext -- Add ons to the basic GTK+ library gdk -- GDK binding source glib -- GLIB binding source gtk -- GTK+ binding source ih -- The home of iHaskell mk -- global makefile definitions

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= INSTALLING =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

See the file `INSTALL'.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= USAGE =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

The installation of Gtk+HS includes a configuration oracle whose name is `gtkhs-config'. It is usually located in a binaries directory, such as `/usr/local/bin/' (the prefix depends on the location into which the whole library has been installed). The configuration oracle provides version information and the compiler options needed to compile and link programs that import Gtk+HS. Given such a program in a single module `Main.hs', we can compile and link as follows (where $HC represents the executable of the Haskell compiler):

$HC -o prgm `gtkhs-config --cflags --libs` Main.hs

Usually, however, when compilation and linking is separate, the output of

gtkhs-config --cflags

determines the compile flags, whereas

gtkhs-config --libs

gives the link flags. The configuration oracle understands the following flags:

  --version             print the version of the current installation
  --cflags              print the compile flags
  --libs                print the link flags
  --prefix              print the installation prefix

If support for `gtkglarea' and/or iHaskell is needed, the arguments `gtkglarea' and `iH', respectively, need to be passed to `gtkhs-config'. Moreover, the Gtk+HS installation needs to have been compiled including support for these two features. If `gtkhs-config' is invoked without any argument, it lists all features supported by the present installation.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= EXTENSIONS =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

There are a number of add-on widgets for GTK+, which are partially in the Gnome CVS, but not in GTK+'s main distribution. Currently, support is provided for

GtkGLArea -- facilitates the display of OpenGL graphics within GTK+ widgets GtkMozEmbed -- supports embedding the Mozilla browser engine in a GTK+ widget Libglade -- supports reading XML widget specifications

As this extension requires extra libraries on the system, they are not build by default. To build them, give the following flags to `./configure'

--enable-gtkglarea
--enable-gtkembedmoz
--enable-libglade

More information on GtkGLArea is at

http://www.student.oulu.fi/~jlof/gtkglarea/

In conjunction with `GtkGLArea', the use of

--with-hopengl=HOPENGL_PATH

is useful to specify the location of Sven Panne's `HOpenGL' library - an OpenGL binding for Haskell available from

http://haskell.org/HOpenGL/

iHaskell

iHaskell is a layer on top of Gtk+Haskell that

(1) provides convenience functions for frequently used programming patterns, (2) haskellises the GTK+ API, and
(3) eliminates the need for explicit mutable variables (`IORef' & friends)

for the representation of the state space of a GUI.

The use of iHaskell can be enabled with

--enable-ih

It requires the Haskell Ports Library, which is available from

http://www.cse.unsw.edu.au/~chak/haskell/ports/

and of which the location can be specified by

--with-ports=PORTS-CONFIG

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- COPYLEFT -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- CREDITS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Authors

Manuel M T Chakravarty <chak@cse.unsw.edu.au>

with contributions from (alphabetical order)

Armin Groesslinger       <agrde@gmx.net>
Michael Hobbs            <hobbs1@acm.org>
Marcin Kowalczyk         <qrczak@knm.org.pl>
Axel Krauth              <krauth@infosun.fmi.uni-passau.de>
Ian Lynagh               <igloo@earth.li>
Simon Marlow             <simonmar@microsoft.com>
Jens-Ulrik Petersen      <petersen@redhat.com>
Axel Simon               <simona@pool.Informatik.rwth-aachen.de>
Peter Strand             <d98peter@dtek.chalmers.se>
Jonas Svensson           <d99josve@dtek.chalmers.se>
Haoran Un                <haoran@unsw.edu.au>
Michael Weber            <michael.weber@post.rwth-aachen.de>
Jamie Wilkinson          <jaq@spacepants.org>

Thanks to Sven Panne <Sven.Panne@informatik.uni-muenchen.de> for corrections, comments, and suggestions. And thanks to Emmanuel Beffara <emmanuel@beffara.org>, Chris Moline <cmoline@shaw.ca>, Donald Stewart <dons@cse.unsw.edu.au>, Volker Stolz <stolz@I2.Informatik.RWTH-Aachen.DE>, Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk>, Shuying Wang <swan936@cse.unsw.edu.au>, Keith Wansbrough <Keith.Wansbrough@cl.cam.ac.uk>, and Carl R. Witty <cwitty@newtonlabs.com> for bug reports and patches.

Bits and pieces of the documentation as well as example code was copied and adapted from the GTK Tutorial by Ian Main <imain@gtk.org> and Tony Gale <gale@gtk.org> as well as the ``The GIMP Toolkit'' reference manual by Peter Mattis and the GTK+ team.

Maintainer

Maintained by Manuel M T Chakravarty <chak@cse.unsw.edu.au> who gratefully accepts any bug reports, suggestions, and code contributions. The latter are implied to be made under the terms of the LGPL.


Sponsored Links

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.