I'm making a simple image downloader to learn some basic gui things in haskell. I have a staticText box that displays the file names while it's downloading them.
The problem I'm having is with this little recursive function.
saveImgs :: [String] -> IO ()
saveImgs [] = return ()
saveImgs (x:xs) = do
let filename = tail $ x =~ "/[^/]*$"
logMessage x
maybeWrite filename =<< (simpleHttp x) `X.catch` statusExceptionHandler
saveImgs xs
where maybeWrite f b | b == L.empty = return ()
| otherwise = L.writeFile f b
It takes the list of urls of images to save, and updates a textCtrl widget. Except, it only ever updates the text once, after the entire thing is done. Is there some way to update the text of a textbox manually?
Update: I tried adding a timer and starting it, but it doesn't do anything.
timerClk <- timer f [on command := windowRefresh logBox False]