added empty GTK-Hello-World-Project
This commit is contained in:
parent
2fa501e272
commit
c46e24befd
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/.dist-buildwrapper
|
||||||
|
/.project
|
||||||
|
/.settings
|
15
COMPILING
Normal file
15
COMPILING
Normal file
@ -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
|
14
Pioneers.cabal
Normal file
14
Pioneers.cabal
Normal file
@ -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
|
||||||
|
|
15
src/Main.hs
Normal file
15
src/Main.hs
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user