Re: more ncurses

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: more ncurses

Paolo Bonzini
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.

aTransparent
    ^0

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.

refresh
    ^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!)

wrefresh
    <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!

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk