\begin{code}
module FranTkConc where
import qualified ConcTcl as C
import GUIDef
import GUI
import Listener
import Concurrent
import IOExts

addCVarListener :: CVar a -> Listener a -> GUI (IO ())
addCVarListener cv l = 
 withGUIDef $ \gui@(GUIDef {guiInfo=g}) -> fixIO $ \rm' -> do
   act <- fireListener' l rm'
   rm <- C.addCVarListener cv (\a -> primAction gui $ act a) g
   return rm


addChanListener :: Chan a -> Listener a -> GUI (IO ())
addChanListener cv l = 
 withGUIDef $ \gui@(GUIDef {guiInfo=g}) -> fixIO $ \rm' -> do
   act <- fireListener' l rm'
   rm <- C.addChanListener cv (\a -> primAction gui $ act a) g
   return rm
\end{code}
