Cookbook/Graphical user interfaces
wxHaskell is a portable and native GUI library for Haskell based on the wxWidgets Library.
Hello World example:
module Main where import Graphics.UI.WX main :: IO () main = start hello hello :: IO () hello = do f <- frame [text := "Hello!"] quit <- button f [text := "Quit", on command := close f] set f [layout := widget quit]
This code was taken from "a quick start with wxHaskell".
Hello world example:
import Graphics.UI.Gtk main :: IO () main = do initGUI w <- windowNew b <- buttonNew set b [buttonLabel := "Quit"] onClicked b $ widgetDestroy w set w [windowTitle := "Hello", containerBorderWidth := 10] containerAdd w b onDestroy w mainQuit widgetShowAll w mainGUI
For more examples, see: Applications and libraries/Games
See also: Applications and libraries/Games