timeout :: Int -> Widget a -> Widget a
timeout mss wa = do 
  id <- genNewId
  liftIO $ storeTimeout id

  cont <- getCont
  ht <- liftIO $ hasTimeout id
  when ht $ setTimeout mss $ do
    ht' <- liftIO $ hasTimeout id
    when ht' $ do 
      removeTimeout id
      runCont cont

  peekTimeout id 
  wa
timeout :: Int -> Widget a -> Widget a
timeout mss wa = do 
  id <- genNewId
  liftIO $ storeTimeout id

  cont <- getCont
  ht <- liftIO $ hasTimeout id
  when ht $ setTimeout mss $ do
    ht' <- liftIO $ hasTimeout id
    when ht' $ do 
      removeTimeout id
      runCont cont

  peekTimeout id 
  wa
timeout mss wa = do 
  id <- genNewId
  liftIO $ storeTimeout id

  cont <- getCont
  ht <- liftIO $ hasTimeout id
  when ht $ setTimeout mss $ do
    ht' <- liftIO $ hasTimeout id
    when ht' $ do 
      removeTimeout id
      runCont cont

  peekTimeout id 
  wa