Created
October 7, 2015 21:14
-
-
Save et4te/e78564a409012d3c6d3c to your computer and use it in GitHub Desktop.
Here the updated baseImgD in templateRenderCanvas will not fire
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
templateRenderImages cnvRef qrcInfoD imgInfo = do | |
qrcInfo <- sample $ current qrcInfoD | |
imgRef <- liftIO $ canvasDisplay cnvRef imgInfo | |
qrcRef <- liftIO $ canvasDisplay cnvRef qrcInfo | |
liftIO $ canvasAddChild cnvRef imgRef | |
liftIO $ imageAddChild imgRef qrcRef | |
templateRenderCanvas qrcInfoD baseImgD cnvRef = do | |
widgetHold (text "Creating base image ...") $ do | |
fmap (templateRenderImages cnvRef qrcInfoD) (updated baseImgD) | |
return () | |
--templateCanvas :: (MonadWidget t m) => TemplateForm t -> m (TemplateCanvas t) | |
templateCanvas :: (MonadWidget t m) => TemplateForm t -> m () | |
templateCanvas tf = do | |
baseImgD <- mkImageInfo (fileInfo tf) defaultImageInfo | |
qrcImgD <- mkQRImageInfo (updated baseImgD) | |
display baseImgD | |
display qrcImgD | |
-- Only ever fire cnvInfo once | |
let cnvInfoE = tag (constant defaultCanvasInfo) (updated baseImgD) | |
cnvRefE <- mkCanvas cnvInfoE | |
widgetHold (text "Creating canvas ...") $ | |
fmap (templateRenderCanvas baseImgD qrcImgD) cnvRefE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment