Personal tools

Gtk2Hs

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(Mac OS X: Add recent experience)
Current revision (20:16, 1 December 2012) (edit) (undo)
(delete outdated links + update some of the information)
 
(39 intermediate revisions not shown.)
Line 7: Line 7:
== Homepage ==
== Homepage ==
-
http://haskell.org/gtk2hs/
+
http://projects.haskell.org/gtk2hs/
-
== Status ==
+
== Tutorials and Demos ==
-
It currently works with Gtk+ 2.0 through to 2.8 on Unix, Win32 and MacOS X.
+
http://www.haskell.org/haskellwiki/Gtk2Hs/Tutorials
-
The widget function coverage is almost complete, only a few minor bits and pieces are missing.
+
-
It currently builds with ghc 5.04.3 through to 6.8.2
+
Some demonstration programs can be found at:
 +
http://code.haskell.org/gtk2hs/gio/demo/
 +
http://code.haskell.org/gtk2hs/pango/demo/
 +
http://code.haskell.org/gtk2hs/cairo/demo/
 +
http://code.haskell.org/gtk2hs/gtk/demo/
-
== Installation Notes ==
+
== Status ==
-
=== Mac OS X ===
+
-
==== Article as of Mid 2008 ====
+
-
Installing Gtk2Hs on Mac requires some finesse, at least until Haskell Libary Platform is built or ghc-6.8.3 is
+
-
available in macports. (These are planned for late 2008.)
+
-
* Install [http://macports.org MacPorts]
+
See [[Gtk2Hs/Installation#Supported_Versions]] for details on which systems should be able to build Gtk2Hs and which are known to be able to build Gtk2Hs.
-
* Install dependencies:
+
-
sudo port instll glade3 libglade2 gstreamer gst-plugins-base gtksourceview cairo librsvg gtkglext firefox
+
-
* Update PKG_CONFIG_PATH (for libraries)
+
-
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig
+
-
* Update ghc to use macports libs: Edit your main <tt>ghc</tt> driver program and change the last line to:
+
-
exec $GHCBIN $TOPDIROPT ${1+"$@"} -L/opt/local/lib -I/opt/local/include
+
-
* Download Gtk2Hs following instructions at [http://www.haskell.org/gtk2hs/downloads/ Gtk2Hs Download page]
+
-
* Check configuration:
+
-
./configure --enable-docs --enable-profiling
+
-
...
+
== Installation Notes ==
-
**************************************************
+
See [[Gtk2Hs/Installation]].
-
* Configuration completed successfully.
+
-
*
+
-
* The following packages will be built:
+
-
*
+
-
* glib : yes
+
-
* gtk : yes
+
-
* glade : yes
+
-
* cairo : yes
+
-
* svgcairo : yes
+
-
* gtkglext : yes
+
-
* gconf : yes
+
-
* sourceview : yes
+
-
* mozembed : yes
+
-
* soegtk : yes
+
-
* gnomevfs : yes
+
-
* gstreamer : yes
+
-
* documentation : yes
+
-
*
+
-
* Now do "(g)make" followed by "(g)make install"
+
-
**************************************************
+
-
* Build and Install:
+
-
make
+
-
sudo make install
+
-
==== Recent experiences ====
+
-
I successfully installed the latest version on Mac OS 10.5 by:
+
-
* Installing Macports.
+
-
* <tt>sudo port install ghc</tt>
+
-
* <tt>sudo port install gtk2hs</tt> - which does not complete successfully. It does however, install the appropriate dependencies. Note that there are so many, you may need to install a couple of times due to time outs etc.. The build of Gtk2HS will fail, but that is ok - continue as below.
+
-
* Remove the build directory under <tt>/opt/.../build/gtk2hs</tt>
+
-
* Download Gtk2Hs via darcs as per [http://haskell.org/gtk2hs/development/#darcs the gtk2hs download instructions]
+
-
* do a <tt>sudo port install automake</tt>
+
-
* do a <tt>sudo port install alex</tt>
+
-
* do a <tt>sudo port install happy</tt> (Note this also fails and must be built from source. See the [[Happy]] page for details.)
+
-
* Follow the build instructions on the [http://haskell.org/gtk2hs/development/#darcs the gtk2hs download page]. I would suggest using <tt>./configure --prefix=/opt/local</tt> to get it in the same place as ports - personal preference though.
+
-
Good luck - as usual, your mileage may vary.
+
== Demos ==
== Demos ==
Line 83: Line 38:
These are links to FAQS on the main site.
These are links to FAQS on the main site.
*[http://haskell.org/gtk2hs/archives/2005/06/23/hiding-the-console-on-windows/#more-26 Hiding the console on windows]
*[http://haskell.org/gtk2hs/archives/2005/06/23/hiding-the-console-on-windows/#more-26 Hiding the console on windows]
-
*[http://haskell.org/gtk2hs/archives/2005/07/24/writing-multi-threaded-guis/#more-38 Writing multi-threaded GUIs]
 
-
*[http://haskell.org/gtk2hs/archives/2005/06/24/building-from-source-on-windows/#more-15 Building on Windows]
 
*[http://haskell.org/gtk2hs/development/#darcs Checkout instructions]. Also see [[Darcs]]
*[http://haskell.org/gtk2hs/development/#darcs Checkout instructions]. Also see [[Darcs]]
[[Category:Applications]]
[[Category:Applications]]

Current revision

Contents

1 What is it?

Gtk2Hs is a Haskell binding to Gtk+ 2.x. Using it, one can write Gtk+ based applications with GHC.

2 Homepage

http://projects.haskell.org/gtk2hs/

3 Tutorials and Demos

http://www.haskell.org/haskellwiki/Gtk2Hs/Tutorials

Some demonstration programs can be found at:

http://code.haskell.org/gtk2hs/gio/demo/
http://code.haskell.org/gtk2hs/pango/demo/
http://code.haskell.org/gtk2hs/cairo/demo/
http://code.haskell.org/gtk2hs/gtk/demo/

4 Status

See Gtk2Hs/Installation#Supported_Versions for details on which systems should be able to build Gtk2Hs and which are known to be able to build Gtk2Hs.

5 Installation Notes

See Gtk2Hs/Installation.

6 Demos

6.1 OpenGL and Gtk2Hs

Gtk2Hs/Demos/GtkGLext/hello.hs

Gtk2Hs/Demos/GtkGLext/terrain.hs requires Gtk2Hs/Demos/GtkGLext/terrain.xpm

7 FAQs

These are links to FAQS on the main site.