module PixmapDisplayF(pixmapDisplayF,pixmapDisplayF',PixmapId) where import AllFudgets import Data.Maybe(maybeToList,isJust) --import Maybe(fromMaybe) pixmapDisplayF = pixmapDisplayF' Nothing pixmapDisplayF' :: Maybe Size -> F (Size,PixmapId) a pixmapDisplayF' optSize = showCommandF "pix" $ windowF ll0 $ k where ll0 = maybeToList (fmap ll optSize) -- This is what I want --ll0 = [ll (fromMaybe 20 optSize)] -- this avoid a problem with autoLayoutF k = getK $ \msg -> case msg of High (size,pixmap) -> putLows (ll1 size++ map XCmd [ChangeWindowAttributes [CWBackPixmap pixmap], ClearWindow]) k _ -> k ll1 = if isJust optSize then const [] else (:[]) . ll ll s = layoutRequestCmd $ plainLayout s True True