GtkTV 0.1.0 → 0.1.1
raw patch · 3 files changed
+16/−22 lines, 3 files
Files
- GtkTV.cabal +1/−1
- examples/test.hs +6/−12
- src/Interface/TV/Gtk.hs +9/−9
GtkTV.cabal view
@@ -1,5 +1,5 @@ Name: GtkTV-Version: 0.1.0+Version: 0.1.1 Cabal-Version: >= 1.2 Synopsis: Gtk-based GUIs for Tangible Values Category: User Interfaces
examples/test.hs view
@@ -27,7 +27,7 @@ --------------------------------------------------------------------} i1 :: In R-i1 = title "size" $ sliderRI (0,10) 3+i1 = title "size" $ sliderRIn (0,10) 3 i2 :: In Bool i2 = title "happy" $ boolIn False@@ -36,7 +36,7 @@ i3 = pair i1 i2 i4 :: In Int-i4 = title "cookies" $ sliderII (0,10) 5+i4 = title "cookies" $ sliderIIn (0,10) 5 -- testI i = runOut "test" (lambda i stringOut) show @@ -46,7 +46,7 @@ -- The explicit typing is unfortunate here. Alternatively, use gtv or runGTV: -testI i = runGTV (tv (oLambda i stringOut) show)+testI i = runGTV (tv (oLambda i showOut) id) t1,t2,t3,t4,t5 :: IO ()@@ -56,30 +56,24 @@ t4 = testI i4 t5 = testI (pair i1 i4) --- t5 = runUI TextureIn "Gtk.hs" print--- t6 = runUI TextureIn "/home/conal/Pictures/phone pics/Image002.jpg" print- o6 :: Out (R -> Bool -> String) o6 = lambda i1 $ lambda i2 $ stringOut t6 :: IO ()--- t6 = runOut "currying" o6 (\ a b -> show (a,b))- t6 = runTV $ tv (title "currying" o6) (curry show) +-- t6 = runOut "currying" o6 (\ a b -> show (a,b))+ {- t7 = testI TextureIn 0 -{- tryTex str = do allInit loadTexture' str >>= print IL.showErrors showGLErrors -t8 = tryTex "/home/conal/Haskell/gadget/src/marble-256.png"-t9 = tryTex "/home/conal/cabal/nehe-tuts-0.1.1/Data/NeHe.bmp"--}+t8 = tryTex "marble-256.png" main = t6
src/Interface/TV/Gtk.hs view
@@ -16,7 +16,7 @@ ( -- * TV type specializations In, Out, GTV, gtv, runGTV -- * UI primitives- , R, sliderRI, sliderII, clockI, fileNameI+ , R, sliderRIn, sliderIIn, clockIn, fileNameIn , module Interface.TV ) where @@ -230,11 +230,11 @@ -- TODO: Consider using R == Double (for constant folding), while really -- being float on the GLSL side. -sliderRI :: (R,R) -> R -> In R-sliderRI = sliderGIn realToFrac realToFrac 0.01 5+sliderRIn :: (R,R) -> R -> In R+sliderRIn = sliderGIn realToFrac realToFrac 0.01 5 -sliderII :: (Int,Int) -> Int -> In Int-sliderII = sliderGIn fromIntegral round 1 0+sliderIIn :: (Int,Int) -> Int -> In Int+sliderIIn = sliderGIn fromIntegral round 1 0 -- Generalized slider. Gtk's scaling widgets work with Double, so this -- adapter takes some initial params for conversion. Only fires when a@@ -256,8 +256,8 @@ -- TODO: experiment with return False vs True return (toWidget w, getter, return ()) -fileNameI :: FilePath -> In FilePath-fileNameI start = primMkI $ \ refresh ->+fileNameIn :: FilePath -> In FilePath+fileNameIn start = primMkI $ \ refresh -> do w <- fileChooserButtonNew "Select file" FileChooserActionOpen fileChooserSetFilename w start onCurrentFolderChanged w refresh@@ -291,8 +291,8 @@ -- | A clock that updates every 1/60 second-clockI :: In R-clockI = clockDtI (1/60)+clockIn :: In R+clockIn = clockDtI (1/60) -- Get the time since midnight, in seconds time :: IO R