packages feed

graphicstools 0.2.1 → 0.2.2

raw patch · 2 files changed

+14/−13 lines, 2 files

Files

Graphics/Tools/Tangible/Instances.hs view
@@ -11,6 +11,7 @@ import Data.List(elemIndex) import Data.Maybe(fromJust) import Graphics.Tools.Tangible+import Control.Monad  instance Tangible Int where   present i act parent = do@@ -50,18 +51,18 @@ instance (Val width, Val height) => Tangible (ConvolutionMask width height) where    present (Mask mat) act parent = do       pnl <- panel parent []-      rec-         let act' _ = mapM (mapM (\s -> get s selection)) spinners-                      >>= act . Mask . M.fromList (w,h) . map fromIntegral . concat-         spinners <- sequence [sequence [(makeSpinner pnl act' element) | element <- row]-                                                               | row <- M.toRows mat ]+      spinners <- sequence [sequence [(makeSpinner pnl element) | element <- row]+                                                                | row <- M.toRows mat ]+      let act' = mapM (mapM (\s -> get s selection)) spinners+                 >>= act . Mask . M.fromList (w,h) . map fromIntegral . concat+      setSpinners (concat spinners) act'       set pnl [layout := grid w h (map (map widget) spinners)]       return pnl     where      s@(w,h) = (val (undefined::width),val (undefined::height))-     makeSpinner pnl act el = do+     setSpinners ss act = forM_ ss $ \s -> set s [on select := get s selection >>= print >> act]+     makeSpinner pnl el = do       s <- spinCtrl pnl (-100) 100 [selection := round el]-      set s [on select := get s selection >>= act]       return s  instance Tangible Bool where@@ -148,24 +149,24 @@   -- instance Default SobelAperture where def = s3--- +-- -- instance Persist SobelAperture where --    put path i = Map.singleton (path++"/SobelAperture") (show i) --    get path   = P.lookupDef (path++"/SobelAperture")--- +-- -- instance Tangible SobelAperture where --   present = mkSelection [("Scharr",sScharr) --                         ,("1",s1) --                         ,("3",s3) --                         ,("5",s5) --                         ,("7",s7)]--- +-- -- instance Default LaplacianAperture where def = l3--- +-- -- instance Persist LaplacianAperture where --    put path i = Map.singleton (path++"/SobelAperture") (show i) --    get path   = P.lookupDef (path++"/SobelAperture")--- +-- -- instance Tangible LaplacianAperture where --   present = mkSelection [("1",l1) --                         ,("3",l3)
graphicstools.cabal view
@@ -1,5 +1,5 @@ Name:                graphicstools-Version:             0.2.1+Version:             0.2.2 Synopsis:            Tools for creating graphical UIs, based on wxHaskell. Description:         This library provides interfaces for creating easily                      graphical UIs especially for computer vision purposes,