From c46e24befd8655bc9033d1b2acd6b89479aca999 Mon Sep 17 00:00:00 2001 From: Stefan Dresselhaus Date: Sun, 22 Dec 2013 23:29:11 +0100 Subject: [PATCH] added empty GTK-Hello-World-Project --- .gitignore | 3 +++ COMPILING | 15 +++++++++++++++ Pioneers | 1 + Pioneers.cabal | 14 ++++++++++++++ Setup.hs | 2 ++ src/Main.hs | 15 +++++++++++++++ 6 files changed, 50 insertions(+) create mode 100644 .gitignore create mode 100644 COMPILING create mode 120000 Pioneers create mode 100644 Pioneers.cabal create mode 100644 Setup.hs create mode 100644 src/Main.hs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..925f33a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/.dist-buildwrapper +/.project +/.settings diff --git a/COMPILING b/COMPILING new file mode 100644 index 0000000..63d00dc --- /dev/null +++ b/COMPILING @@ -0,0 +1,15 @@ +set up external dependencies: + +> cabal install gtk2hs-buildtools + +make sure these are in your PATH (e.g. include $HOME/.cabal/bin in your $PATH) + + +install dependencies & configure app +> cabal install --only-dependencies +> cabal configure + +build +> cabal build + +run file from dist/build/Pioneers/Pioneers diff --git a/Pioneers b/Pioneers new file mode 120000 index 0000000..298a935 --- /dev/null +++ b/Pioneers @@ -0,0 +1 @@ +dist/build/Pioneers/Pioneers \ No newline at end of file diff --git a/Pioneers.cabal b/Pioneers.cabal new file mode 100644 index 0000000..fb1c76a --- /dev/null +++ b/Pioneers.cabal @@ -0,0 +1,14 @@ +name: Pioneers +version: 0.1 +cabal-version: >=1.2 +build-type: Simple +author: sdressel + +executable Pioneers + hs-source-dirs: src + main-is: Main.hs + build-depends: + base >= 4, + gtk + ghc-options: -Wall + diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..9a994af --- /dev/null +++ b/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/src/Main.hs b/src/Main.hs new file mode 100644 index 0000000..fa5963d --- /dev/null +++ b/src/Main.hs @@ -0,0 +1,15 @@ + +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 World") + onDestroy window mainQuit + widgetShowAll window + mainGUI