deskDimCont :: DesktopConstraint -> Hoodle EditMode -> DesktopDimension 
deskDimCont cnstrnt hdl =  
    let pgs = toList . view gpages $ hdl
        len = length pgs 
        olst = maybeError' "deskDimCont" $
          mapM (pageArrFuncCont cnstrnt hdl . PageNum) [0..len-1]
        f (PageOrigin (x,y),PageDimension (Dim w h)) (Dim w' h') = 
          let w'' = if w' < x+w then x+w else w' 
              h'' = if h' < y+h then y+h else h' 
          in Dim w'' h''
    in DesktopDimension $ foldr f (Dim 0 0) olst
deskDimCont :: DesktopConstraint -> Hoodle EditMode -> DesktopDimension
deskDimCont cnstrnt hdl =  
    let pgs = toList . view gpages $ hdl
        len = length pgs 
        olst = maybeError' "deskDimCont" $
          mapM (pageArrFuncCont cnstrnt hdl . PageNum) [0..len-1]
        f (PageOrigin (x,y),PageDimension (Dim w h)) (Dim w' h') = 
          let w'' = if w' < x+w then x+w else w' 
              h'' = if h' < y+h then y+h else h' 
          in Dim w'' h''
    in DesktopDimension $ foldr f (Dim 0 0) olst
deskDimCont cnstrnt hdl =  
    let pgs = toList . view gpages $ hdl
        len = length pgs 
        olst = maybeError' "deskDimCont" $
          mapM (pageArrFuncCont cnstrnt hdl . PageNum) [0..len-1]
        f (PageOrigin (x,y),PageDimension (Dim w h)) (Dim w' h') = 
          let w'' = if w' < x+w then x+w else w' 
              h'' = if h' < y+h then y+h else h' 
          in Dim w'' h''
    in DesktopDimension $ foldr f (Dim 0 0) olst