Sunday, July 25, 2010

More NCurses

Since someone actually commented on my original post here is a status update
I've actually moved to starting again from scratch, with a wrapper that is more modern than the one I found (It still had semicolons at the end of each line). My new version is already somewhat more comprehensive though nowhere near complete.

One of the changes I've made is to allow method chaining so instead of adding the move and do X method for every single operation I have a Mv and Color and Set (as in attrset) which return the window you called them on. This allows calls like:

window.Mv(10,10).Set(curses.A_BOLD).COLOR(4).AddStr("Hello World")

or better yet:

fmt.FPrintf(window(10,10).Set(curses.A_BOLD).COLOR(4), "Hello World")

Yes I made Ncurses Window type implement the Writer interface : )

And as to releasing it back. I absolutely plan too. Though I still have a few Items I want to get working first such as:
  1. Make my InitScreen take configuration options so that it can set things like CBreak, NoEcho and Keypad for you (I already have it initilising the color system if required.
  2. Implement the border drawing primitives though this is just fairly mechanical work.
  3. Add basic wrappers for the related panel, and menu libraries. I'm still trying to decide how all this should be packaged.

Thursday, July 22, 2010

Messing about NCurses and Go

So recently I update by go installation and then installed an ncurses library. I quickly discoverd that the ncurses wrapper is incomplete and tends to not be very goanic.

So far I've added a whole host of missing methods and changed a few others. I also added a Write method which lets ncurses Windows work with the methods in the fmt package. I'll have to see if the original author is interested in my changes as I do seem to be taking the wrapper in a slightly different direction.

All together it has been an interesting way of playing with the go language.

Wednesday, July 21, 2010

The Hogfather

I finally got around to seeing the Hogfather. It was good, but not as good as the book. I suspect that the problem may be that it is hard to translate Pratchett to the screen. The Discworld definitely can be a dark place. But it is also a very funny one. The film treatment had the darkness down, but lacked the humor.

It was marked as PG so I thought I would watch it with my boys however we only got a few scenes in before I decided that it was likely to give them nightmares.

Often the humor in Discworld is not in what the characters see but how it is described and what they think in reaction to it, and there are also frequent side thoughts and even the odd footnote (even some of the footnotes have footnotes). All of this is hard to get into a medium that uses images rather then words to describe, and considers it bad form to make thoughts audible.