Introduction to Functional Programming -- Installing Gtk2Hs | TDA555 / DIT440, LP1, HT2012 |
Home | Schedule | Labs | Exercises | Exam | About | Fire | Forum | TimeEdit | Links | 2011 |
Here follow installation instructions for Gtk2Hs, for both Windows and Ubuntu.
Please understand that we can provide very limited support if you are having problems with this. If you need help, chances are that someone else has had similar issues; so use the course forum for help!
Installing Gtk2Hs on Windows at home Step-by-step instructions. 1. Download the Haskell Platform installer for Windows from http://hackage.haskell.org/platform/windows.html and install it using the default settings (just keep clicking 'next.') 2. Download the latest all-in-one bundle for Gtk2Hs from here: http://www.gtk.org/download-windows.html (that's 2.20 at the time of writing) and unpack it to C:\gtk 3. Download MinGW, a GNU command line environment that is required to build Gtk2Hs, from here: http://sourceforge.net/projects/mingw/files_beta/Automated%20MinGW%20Installer/ and install it to C:\MinGW. Use the default settings for everything else (that is, keep clicking next after you've entered C:\MinGW as the install path.)
4. Add the GTK and MinGW binaries to your path environment variable;
the exact process differs slightly depending on your Windows version,
but on Windows 7, instructions are as follows: On Windows XP, the process is pretty much the same except that you skip the "click the advanced system settings link" step. 5. Start a command shell (for example by entering "cmd" in the "run" field of the start menu and hitting return.) 6. In the command shell, run the following commands, waiting for each one to finish, in sequence: cabal update cabal install gtk2hs-buildtools cabal install gtk 7. Congratulations - you should now have a working Gtk2Hs install! Installing Gtk2Hs on Ubuntu at home There are two possibilities:
If you have done that, you can install Gtk2Hs by typing the following three commands: cabal update cabal install gtk2hs-buildtools cabal install gtk
If you do not have the Haskell Platform on your Ubuntu machine, the easiest way to install gtk2hs on an Ubuntu computer is to just install the libghc6-gtk-dev package. This can be done by searching for it in the Synaptic Package Manager, or simply typing this in the shell: sudo apt-get install libghc6-gtk-devIf you install gtk2hs in this way, you will have to give the flag -package gtk when you run ghci or ghc: ghc -package gtk --make MyProgram |