Connecting telnet connection to a wx widget

Hi, I am stuck at this problem. I want to read from a telnet connection and display the result in a wxHaskell widget (textCtrl). I got the widget and I got the connection piped to stdout, but I don´t know how to connect the two. Any help is greatly appreciated! Versions: conduit 1.2.0.2, wx 0.91.0.0 Thanks a lot, Tilmann This is the code I got so far: module Main where import Control.Concurrent (forkIO, killThread) import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Monad.Trans.Resource import Data.Conduit import Data.Conduit.Binary import Network (connectTo, PortID (..)) import System.IO import Graphics.UI.WX main = start gui gui = do f <- frame [] t <- textCtrl f [] e <- entry f [on click := (onClick t "...")] set f [layout := boxed "console" (grid 5 5 [[floatLeft $ expand $ hstretch $ widget t] ,[expand $ hstretch $ widget e]])] onClick t val pt = set t [ text :~ \x -> val] -- http://www.mega-nerd.com/erikd/Blog/CodeHacking/Haskell/telnet-conduit.html telnet :: String -> Int -> IO () telnet host port = runResourceT $ do (releaseSock, hsock) <- allocate (connectTo host $ PortNumber $ fromIntegral port) hClose (releaseThread, _) <- allocate (forkIO $ runResourceT $ sourceHandle stdin $$ sinkHandle hsock) killThread sourceHandle hsock $$ sinkHandle stdout

On Wed, 01 Oct 2014 12:37:36 +0200, Tilmann
Hi,
I am stuck at this problem. I want to read from a telnet connection and display the result in a wxHaskell widget (textCtrl). I got the widget and I got the connection piped to stdout, but I don´t know how to connect the two. Any help is greatly appreciated! : :
As you haven't got an answer yet, it looks like there is no one with both wxHaskell and Conduit knowledge on this mailing list; I suggest to try the Haskell Café mailing list. Regards, Henk-Jan van Tuyl -- Folding@home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming --
participants (2)
-
Henk-Jan van Tuyl
-
Tilmann