[Haskell-beginners] install wxHaskell on osx 10.7 64bit

Miguel Negrao miguel.negrao-lists at friendlyvirus.org
Mon Apr 9 01:50:42 CEST 2012


Ok, by deleting all the examples I managed to install reactive-banana-wx. The Couter.hs example runs fine.

I’m now trying to do a example where the value of a slider is posted to text box, but I can’t get it to work. event0 is for events that don’t ouput anything, but slider has a value.... what should I do ?

{-----------------------------------------------------------------------------    
   A slider and a text box
------------------------------------------------------------------------------}
{-# LANGUAGE ScopedTypeVariables #-} -- allows "forall t. NetworkDescription t"


import Graphics.UI.WX hiding (Event)
import Reactive.Banana
import Reactive.Banana.WX

{-----------------------------------------------------------------------------
   Main
------------------------------------------------------------------------------}
main:: IO()
main = start $ do
   f       <- frame [text := "A slider"]
   sl      <- hslider f False 0 100 []
   output  <- staticText f []

   set f [layout := margin 10 $
           column 25 [widget sl, widget output]]

   let networkDescription :: forall t. NetworkDescription t ()
       networkDescription = do

       esl   <- event0 sl command
       let b = stepper 0 esl    -- this doesn’t work off course...
       sink output [text :== show <$> b] 

   network <- compile networkDescription    
   actuate network

thanks
Miguel Negrão





More information about the Beginners mailing list