binding-wx 0.2 → 0.2.1
raw patch · 4 files changed
+23/−8 lines, 4 filesdep +binding-wxdep +directorydep ~basedep ~binding-core
Dependencies added: binding-wx, directory
Dependency ranges changed: base, binding-core
Files
- binding-wx.cabal +17/−6
- demo/in.txt +0/−1
- demo/lists.hs +5/−1
- src/Graphics/UI/WX/Binding.hs +1/−0
binding-wx.cabal view
@@ -1,23 +1,34 @@ name: binding-wx -version: 0.2 -cabal-version: >= 1.6 +version: 0.2.1 +cabal-version: >= 1.9.2 license: BSD3 license-file: LICENSE author: Gideon Sireling -maintainer: haskell@accursoft.org +maintainer: code@accursoft.org homepage: http://code.accursoft.com/binding bug-reports: http://code.accursoft.com/binding/issues -synopsis: binding-core wrapper for WxHaskell +synopsis: Data Binding in WxHaskell build-type: Simple category: GUI, User Interfaces -extra-source-files: demo/simple.hs demo/lists.hs, demo/in.txt description: Bind mutable data and lists to WxHaskell widgets. Examples are provided by the included demo programs. library - build-depends: base <5, wxcore, wx, binding-core, stm + build-depends: base <5, wxcore, wx, binding-core >=0.2, stm hs-source-dirs: src exposed-modules: Graphics.UI.WX.Binding + +test-suite simple + type: exitcode-stdio-1.0 + main-is: simple.hs + build-depends: base, wx, binding-core >=0.2, binding-wx + hs-source-dirs: demo + +test-suite lists + type: exitcode-stdio-1.0 + main-is: lists.hs + build-depends: base, wx, binding-core >=0.2, binding-wx, directory + hs-source-dirs: demo source-repository head type: hg
− demo/in.txt
@@ -1,1 +0,0 @@-[Person {name = "Joe", age = 32, active = True},Person {name = "Fred", age = 50, active = False},Person {name = "Alice", age = 43, active = True}]
demo/lists.hs view
@@ -2,13 +2,17 @@ import Data.IORef import Data.List import Graphics.UI.WX +import System.Directory import Data.Binding.List import Graphics.UI.WX.Binding data Person = Person {name::String, age::Int, active::Bool} deriving (Read, Show) -main = do --read the input +main = do --create an input file if none exists + doesFileExist "in.txt" >>= (`unless` writeFile "in.txt" + "[Person {name = \"Joe\", age = 32, active = True},Person {name = \"Fred\", age = 50, active = False},Person {name = \"Alice\", age = 43, active = True}]") + --read the input f <- readFile "in.txt" bl <- toBindingList $ read f :: IO (BindingList IORef Person) start $ do --create widgits
src/Graphics/UI/WX/Binding.hs view
@@ -53,6 +53,7 @@ writeVar source (read d) propagateEvent] +{-# ANN navigation "HLint: ignore Use void" #-} -- | Create a set of navigation buttons for a binding list. navigation :: Variable v => Window w -- ^ the buttons' owner