fltkhs-hello-world (empty) → 0.0.0.2
raw patch · 5 files changed
+90/−0 lines, 5 filesdep +basedep +fltkhsbuild-type:Customsetup-changed
Dependencies added: base, fltkhs
Files
- .gitignore +1/−0
- LICENSE +21/−0
- Setup.hs +6/−0
- fltkhs-hello-world.cabal +34/−0
- src/hello-world.hs +28/−0
+ .gitignore view
@@ -0,0 +1,1 @@+dist/*
+ LICENSE view
@@ -0,0 +1,21 @@+The MIT License (MIT)++Copyright (c) 2013 Aditya Siram ++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in+all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN+THE SOFTWARE.
+ Setup.hs view
@@ -0,0 +1,6 @@+module Main (main) where++import Distribution.Simple++main :: IO ()+main = defaultMain
+ fltkhs-hello-world.cabal view
@@ -0,0 +1,34 @@+name : fltkhs-hello-world+version : 0.0.0.2+synopsis : Fltkhs template project+description:+ Starter kit for an FLTKHS project+license : MIT+license-file : LICENSE+author : Aditya Siram+build-type: Custom+maintainer: aditya.siram@gmail.com+homepage: http://github.com/deech/fltkhs-hello-world+category: UI,Graphics+cabal-version: >=1.20+source-repository head+ type: git+ location: http://github.com/deech/fltkhs-hello-world++Flag FastCompile+ Description: Turn off optimizations for faster compilation+ Manual: True+ Default: False++Executable fltkhs-hello-world+ Main-Is: hello-world.hs+ Hs-Source-Dirs: src/+ Build-Depends:+ base == 4.*,+ fltkhs >= 0.4.0.0+ default-language: Haskell2010+ ghc-Options: -Wall -threaded+ if impl(ghc >= 7.10) && flag(FastCompile)+ ghc-Options: -fno-specialise -fmax-simplifier-iterations=0 -fsimplifier-phases=0+ if !os(darwin)+ ghc-Options: -pgml g++ "-optl-Wl,--whole-archive" "-optl-Wl,-Bstatic" "-optl-Wl,-lfltkc" "-optl-Wl,-Bdynamic" "-optl-Wl,--no-whole-archive"
+ src/hello-world.hs view
@@ -0,0 +1,28 @@+module Main where+import qualified Graphics.UI.FLTK.LowLevel.FL as FL+import Graphics.UI.FLTK.LowLevel.Fl_Types+import Graphics.UI.FLTK.LowLevel.FLTKHS++buttonCb :: Ref Button -> IO ()+buttonCb b' = do+ l' <- getLabel b'+ if (l' == "Hello world")+ then setLabel b' "Goodbye world"+ else setLabel b' "Hello world"++main :: IO ()+main = do+ window <- windowNew+ (Size (Width 115) (Height 100))+ Nothing+ Nothing+ begin window+ b' <- buttonNew+ (Rectangle (Position (X 10) (Y 30)) (Size (Width 95) (Height 30)))+ (Just "Hello world")+ setLabelsize b' (FontSize 10)+ setCallback b' buttonCb+ end window+ showWidget window+ _ <- FL.run+ return ()