@@ -43,6 +43,7 @@ module Reflex.Vty.Widget
4343 , splitV
4444 , splitVDrag
4545 , box
46+ , boxStatic
4647 , text
4748 , display
4849 , hyphenBoxStyle
@@ -489,19 +490,19 @@ roundedBoxStyle = BoxStyle '╭' '─' '╮' '│' '╯' '─' '╰' '│'
489490
490491-- | Draws a box in the provided style and a child widget inside of that box
491492box :: (Monad m, Reflex t)
492− => BoxStyle
493+ => Behavior t BoxStyle
493494 -> VtyWidget t m a
494495 -> VtyWidget t m a
495−box style child = do
496+box boxStyle child = do
496497 sz <- displaySize
497498 let boxReg = ffor (current sz) $ \(w,h) -> Region 0 0 w h
498499 innerReg = ffor sz $ \(w,h) -> Region 1 1 (w - 2) (h - 2)
499− tellImages (fmap boxImages boxReg)
500+ tellImages (boxImages <$> boxStyle <*> boxReg)
500501 tellImages (fmap (\r -> [regionBlankImage r]) (current innerReg))
501502 pane innerReg (pure True) child
502503 where
503− boxImages :: Region -> [Image]
504− boxImages (Region left top width height) =
504+ boxImages :: BoxStyle -> Region -> [Image]
505+ boxImages style (Region left top width height) =
505506 let right = left + width - 1
506507 bottom = top + height - 1
507508 sides =
@@ -526,6 +527,14 @@ box style child = do
526527 ]
527528 in sides ++ if width > 1 && height > 1 then corners else []
528529
530+-- | A box whose style is static
531+boxStatic
532+ :: (Reflex t, Monad m)
533+ => BoxStyle
534+ -> VtyWidget t m a
535+ -> VtyWidget t m a
536+boxStatic = box . pure
537+
529538-- | Renders text, wrapped to the container width
530539text
531540 :: (Reflex t, Monad m)