main :: IO()
main = runCurses $ do
setEcho False
w <- defaultWindow
canvas <- newWindow 19 19 0 0
panel <- newPanel canvas
updateWindow canvas $ do
drawString "Hello world!"
render
waitFor w (\ev -> ev == EventCharacter 'q' || ev == EventCharacter 'Q')
waitFor :: Window -> (Event -> Bool) -> Curses ()
waitFor w p = loop where
loop = do
ev <- getEvent w Nothing
case ev of
Nothing -> loop
Just ev' -> unless (p ev') loop
Hello. It is a bit modified example of ncurses package.
Problem is that is do not display anything. In C API, as I remember, I have to refresh each window independently. But Haskell offer only render
. Where I am wrong? I want to have some moveable widget.
You have just to call refreshPanels
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With