added Beispielcode for GUI

This commit is contained in:
Nicole Dresselhaus 2016-06-21 11:04:02 +02:00
parent 823ddb3991
commit 003c995794
2 changed files with 22 additions and 0 deletions

13
Beispiele/animatedGUI.hs Normal file
View File

@ -0,0 +1,13 @@
import Data.Monoid
import Graphics.Gloss
import Graphics.Gloss.Data.Color (makeColor, red)
main :: IO ()
main = animate (InWindow "Spin around" (500,500) (100,100))
(makeColor 0.9 0.9 0.9 1)
(\time ->
Pictures [ Color red $ ThickCircle 500 1000
, Rotate (time/60*360)
$ Text
$ show (round time) <> " Seconds"
])

9
Beispiele/staticGUI.hs Normal file
View File

@ -0,0 +1,9 @@
import Graphics.Gloss
import Graphics.Gloss.Data.Color (makeColor, red)
main :: IO ()
main = display (InWindow "Hello World" (500,500) (100,100))
(makeColor 0.9 0.9 0.9 1)
(Pictures [ Color red (Circle 1000)
, Text "Hello World Text"
])