Projects that depend on the vty package?

Hello, For further development of the vty package I'm really only paying attention to the requirements that fall out of the Yi project. Are there any other projects that depend on the vty package? In addition, the vty project has it's own wiki: http://trac.haskell.org/vty/ Right now there isn't much information there but it is a great place to send bug reports or enhancement requests if you have them. Cheers, Corey O'Connor

Hi Corey.. I noticed this thread via Haskell Weekly News. Corey O'Connor wrote:
For further development of the vty package I'm really only paying attention to the requirements that fall out of the Yi project. Are there any other projects that depend on the vty package?
Why yes! I just used it within the hledger project. I found it easier to get started with the (h/nano)curses libs. From your cursor-moving example I started tweaking and soon had a working ui. It works well here and I'm hoping it will be pretty robust across platforms. More top of the head feedback: I liked the level of abstraction, it seems to handle a lot of routine stuff for me. I liked to hear that it avoids flicker that (apparently) curses suffers from. I expected renderBS to convert a multiline string into an Image of height > 1. It might be nice if the <-> and <|> combinators were more forgiving about mismatching dimensions, I get unexpected failures from them. After a failure like this my program quits but the terminal is not properly reset until I run "reset" manually. I believe vty supports only whole-screen updates, and you could write more performant uis by careful use of *curses ? My experiment is quick enough for regular use on my macbook, but I can only move the cursor so fast and when I highlight the whole line that it's on there is noticeable double-display while I move. I haven't tried profiling yet. I'd welcome any tips on how to write a cross-platform TUI that updates instantly! So thank you and Stefan O'Rear very much indeed! -Simon

On Sat, Dec 6, 2008 at 2:21 PM, Simon Michael
Hi Corey.. I noticed this thread via Haskell Weekly News.
Corey O'Connor wrote:
For further development of the vty package I'm really only paying attention to the requirements that fall out of the Yi project. Are there any other projects that depend on the vty package?
Why yes! I just used it within the hledger project.
Thanks for the reply! I will try out hledger and verify (As much as I can) that I don't introduce regressions with any changes I make. I'm going to add the issues you outline below to VTY's issue tracker (http://trac.haskell.org/vty/) If you think of anything else feel free to file an issue there. Though reports directly sent to me or added to the Yi issue tracker will work as well.
I expected renderBS to convert a multiline string into an Image of height > 1.
Agreed. http://trac.haskell.org/vty/ticket/8
It might be nice if the <-> and <|> combinators were more forgiving about mismatching dimensions, I get unexpected failures from them. After a failure like this my program quits but the terminal is not properly reset until I run "reset" manually.
Oh definitely. This bit me a few times when adding GUI tabs to Yi. I'd much prefer not to have to worry about matching dimensions. http://trac.haskell.org/vty/ticket/9
I believe vty supports only whole-screen updates, and you could write more performant uis by careful use of *curses ? My experiment is quick enough for regular use on my macbook, but I can only move the cursor so fast and when I highlight the whole line that it's on there is noticeable double-display while I move. I haven't tried profiling yet. I'd welcome any tips on how to write a cross-platform TUI that updates instantly!
Some optimization is attempted on update. I haven't looked into the details of how this is done yet. There is an issue with the current process with regards to multi-byte characters. After I investigate that issue I should know more. Cheers, Corey O'Connor

coreyoconnor:
Hello, For further development of the vty package I'm really only paying attention to the requirements that fall out of the Yi project. Are there any other projects that depend on the vty package?
In addition, the vty project has it's own wiki: http://trac.haskell.org/vty/ Right now there isn't much information there but it is a great place to send bug reports or enhancement requests if you have them.
You can grep the complete .cabal file set on hackage, which I did, yielding the following versions of the follwoing packages: ./yi-vty/0.3/yi-vty.cabal ./yi-vty/0.2/yi-vty.cabal ./yi-vty/0.2.1/yi-vty.cabal ./yi/0.4.1/yi.cabal ./yi/0.4.6/yi.cabal ./yi/0.3/yi.cabal ./yi/0.5.0.1/yi.cabal ./yi/0.2/yi.cabal ./yi/0.4.3/yi.cabal ./yi/0.4.6.2/yi.cabal ./yi/0.5.2/yi.cabal ./yi/0.4/yi.cabal ./LambdaHack/0.1.20080413/LambdaHack.cabal ./LambdaHack/0.1.20080412/LambdaHack.cabal -- Don

On Wed, Dec 3, 2008 at 7:57 PM, Corey O'Connor
Hello, For further development of the vty package I'm really only paying attention to the requirements that fall out of the Yi project. Are there any other projects that depend on the vty package?
In addition, the vty project has it's own wiki: http://trac.haskell.org/vty/ Right now there isn't much information there but it is a great place to send bug reports or enhancement requests if you have them.
I haven't been using it for anything real, but I was playing around with it in preparation for yet another project that hasn't taken off (and it never might). Anyway, it is a nice _low-level_ library, do you have any plans on building convenient things on top of it? Basic widgets such as dialogues and lists spring to mind... This is a rather pathetic list widget I came up with at the time: module Main where import Data.Maybe import Graphics.Vty import qualified Data.ByteString.Char8 as B options = [ "01 Foo", "02 Bar", "03 Baz", "04 Qux", "05 Quux", "06 Quuux", "07 Foo", "08 Bar", "09 Baz", "10 Qux", "11 Quux", "12 Quuux", "13 Foo", "14 Bar", "15 Baz", "16 Qux", "17 Quux", "18 Quuux", "19 Foo", "20 Bar", "21 Baz", "22 Qux", "23 Quux", "24 Quuux", "25 Foo", "26 Bar", "27 Baz", "28 Qux", "29 Quux", "30 Quuux", "31 Foo", "32 Bar", "33 Baz", "34 Qux", "35 Quux", "36 Quuux", "37 Foo", "38 Bar", "39 Baz", "40 Qux", "41 Quux", "42 Quuux", "43 Foo", "44 Bar", "45 Baz", "46 Qux", "47 Quux", "48 Quuux", "49 Foo", "50 Bar", "51 Baz", "52 Qux", "53 Quux", "54 Quuux", "55 Foo", "56 Bar", "57 Baz", "58 Qux", "59 Quux", "60 Quuux" ] main :: IO () main = do vt <- mkVty getChoice vt options >>= putStrLn . show {- - List choice widget for Vty. -} getChoice :: Vty -> [String] -> IO (Maybe (Int, String)) getChoice vt opts = do (sx, sy) <- getSize vt _getChoice vt opts 0 sx sy _getChoice vt opts idx sx sy = let _calcTop winHeight listLength idx = max 0 ((min listLength ((max 0 (idx - winHeight `div` 2)) + winHeight)) - winHeight) _top = _calcTop sy (length opts) idx _visible_opts = take sy (drop _top opts) in do update vt (render _visible_opts (idx - _top) sx) k <- getEvent vt case k of EvKey KDown [] -> _getChoice vt opts (min (length opts - 1) (idx + 1)) sx sy EvKey KUp [] -> _getChoice vt opts (max 0 (idx - 1)) sx sy EvKey KEsc [] -> shutdown vt >> return Nothing EvKey KEnter [] -> shutdown vt >> return (Just $ (idx, opts !! idx)) EvResize nx ny -> _getChoice vt opts idx nx ny _ -> _getChoice vt opts idx sx sy render opts idx sx = pic { pImage = foldr1 (<->) $ map _render1 $ zip [0..] opts } where _render1 (i, o) = renderHFill attr ' ' 5 <|> renderBS (_attr i) (B.pack o) <|> renderHFill attr ' ' (sx - 5 - length o) _attr i = if i /= idx then attr else setRV attr /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) magnus@therning.org Jabber: magnus@therning.org http://therning.org/magnus identi.ca|twitter: magthe
participants (4)
-
Corey O'Connor
-
Don Stewart
-
Magnus Therning
-
Simon Michael