[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Re: more ncurses

From: Paolo Bonzini
Subject: [Help-smalltalk] Re: more ncurses
Date: Wed, 11 Oct 2006 17:28:41 +0200
User-agent: Thunderbird (Macintosh/20060909)

Brad Watson wrote:
Awsesome.  I'd be happy to add the constants.  Have a small example of how you 
would like them presented ?

Kind regards,
Many small methods, with their names "smalltalkized", will be fine.


or something like that.

You may also have noted that I now support stdscr; I cheated a bit, in that I wrap initscr and save the result in a class variable. With this in place, the stdscr functions could actually be written in smalltalk, e.g.

   ^self wrefresh: self stdscr

but this is not important at all, given that what you have works. Likewise, one may like to give x/y coordinates as points, but nothing very important too.

What could be more interesting, is to have WINDOW be a subclass of CObject, for example NCWindow. First, you give "NCWindow type" as the return type of initscr, newwin, and so on. Then, declare methods such as wrefresh like this (under NCWindow, not under NCurses anymore!)

   <cCall: 'wrefresh' returning: #int args: #(#self )>!

Using #self, the zero-argument message becomes a one-argument function. So, after doing this, ncurses methods will be half class methods in NCurses, and half instance methods in NCWindow. It may make sense, actually, to remove NCurses completely and just have NCWindow (with both class, and instance methods).

If you want to do this work, not only I will be grateful, but you will also learn a lot. :-) First the constants, though (that's just an advice).

Keep up the good work!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]