- cabal-dev init
- Hello.cabalを編集する
- cabal-dev configure
- export PATH="${PWD}/cabal-dev/bin":${PATH}
- cabal-dev install gtk2hs-buildtools
- LANG=C cabal-dev install ** LANG=Cが無いと通らない
Created
July 12, 2013 09:49
-
-
Save mmitou/5983220 to your computer and use it in GitHub Desktop.
gtk2hsでHello, world
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Initial Hello.cabal generated by cabal init. For further | |
| -- documentation, see http://haskell.org/cabal/users-guide/ | |
| name: Hello | |
| version: 0.1.0.0 | |
| synopsis: Hello world | |
| -- description: | |
| homepage: http://foobar | |
| license: MIT | |
| license-file: LICENSE | |
| author: mmitou | |
| maintainer: ito_ma@worksap.co.jp | |
| -- copyright: | |
| -- category: | |
| build-type: Simple | |
| cabal-version: >=1.8 | |
| executable Hello | |
| main-is: Main.hs | |
| -- other-modules: | |
| build-depends: base ==4.6.*, | |
| gtk ==0.12.4, | |
| cairo ==0.12.4, | |
| glib ==0.12.4, | |
| pango ==0.12.4, | |
| gio ==0.12.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Main where | |
| import Graphics.UI.Gtk | |
| main :: IO () | |
| main = do | |
| initGUI | |
| window <- windowNew | |
| button <- buttonNew | |
| set window [ containerBorderWidth := 10, containerChild := button ] | |
| set button [ buttonLabel := "Hello World" ] | |
| onClicked button (putStrLn "Hello!") | |
| onDestroy window mainQuit | |
| widgetShowAll window | |
| mainGUI |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment