[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ncurses howto examples available

Bauduin Raphael

2/5/2005 3:09:00 PM

Hi,

I looked for some example code of ruby with ncurses and didn't find any.
To learn a bit about it, I followed the documentation available at
http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/... and
transposed it some examples to ruby.

I put those files available at
http://www.raphinou.com/rubyncurses-ex... .


I'm now looking for examples of the use of some more advanced features
of ncurses libraries like those listed at the end of the howto:

Panels: http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/p...
Menus: http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/...
Forms: http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/...
CDK: http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/tool...

Does anyone know if those are usable with the ruby ncurses library? Any
example out there?

Thanks.

Raph
5 Answers

Tobias Peters

2/6/2005 12:58:00 AM

0

Bauduin Raphael wrote:
> I put those files available at
> http://www.raphinou.com/rubyncurses-ex... .

Thanks for translating these. I'll have a look soon.

> Panels: http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/p...
> Menus: http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/...
> Forms: http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/...
> CDK: http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/tool...
>
> Does anyone know if those are usable with the ruby ncurses library? Any
> example out there?

Panel and form are supported. See the end of the README file in
ncurses-ruby.

And maybe you have missed the "examples" directory of ncurses-ruby?

Tobias

Bauduin Raphael

2/6/2005 12:05:00 PM

0

Tobias Peters wrote:
> Bauduin Raphael wrote:
>
>> I put those files available at
>> http://www.raphinou.com/rubyncurses-ex... .
>
>
> Thanks for translating these. I'll have a look soon.
>
>> Panels: http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/p...
>> Menus: http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/...
>> Forms: http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/...
>> CDK: http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/tool...
>>
>> Does anyone know if those are usable with the ruby ncurses library?
>> Any example out there?
>
>
> Panel and form are supported. See the end of the README file in
> ncurses-ruby.

Ok, thanks. I missed that indeed, but it's quite normal as higher in the
document there is:

"If you don't know how to use ncurses from C, then stop reading here,
and read an introduction to ncurses."

and I followed this instruction :-)

Having read it now, I'm looking for the form2.rb example it mentions.
(It doesn't seem to be included in the Debian package). Are there good
examples available somewhere?


>
> And maybe you have missed the "examples" directory of ncurses-ruby?

I saw these and they helped me starting, but they are limited in scope.


Thanks.

Raph

>
> Tobias

Tobias Peters

2/6/2005 2:33:00 PM

0

Bauduin Raphael wrote:
>> Panel and form are supported. See the end of the README file in
>> ncurses-ruby.
>
>
> Ok, thanks. I missed that indeed, but it's quite normal as higher in the
> document there is:
>
> "If you don't know how to use ncurses from C, then stop reading here,
> and read an introduction to ncurses."
>
> and I followed this instruction :-)
>
> Having read it now, I'm looking for the form2.rb example it mentions.
> (It doesn't seem to be included in the Debian package).

I see. Sorry about that. At one point, I became tired answering basic
ncurses questions that were unrelated to the ruby binding. I should add
that the reader should continue with the readme after acquiring basic
ncurses knowledge.

> Are there good
> examples available somewhere?

I think "raggle" uses ncurses. "aeditor" did so once, but I do not know
if it does still.

Tobias

Simon Strandgaard

2/6/2005 3:17:00 PM

0

On Sun, 6 Feb 2005 23:55:11 +0900, Tobias Peters
<tpeters@invalid.uni-oldenburg.de> wrote:
[snip]
> "aeditor" did so once, but I do not know if it does still.


AEditor 0.x uses your ncurses lib.
AEditor 1.x uses fxruby.

AEditor 2.x uses my own wrapper for ncursesw, so I can deal with unicode.
See shot: http://aeditor.rubyforge.org/aeditor_sho...


There exists 2 other editors that uses curses/ncurses:
ruvi. http://ruvi.ruby...
diakonos. http://purepistos.net...

--
Simon Strandgaard


Tobias Peters

2/6/2005 9:38:00 PM

0

>>> http://www.raphinou.com/rubyncurses-ex... .
>> Thanks for translating these. I'll have a look soon.

I've looked at your examples and have the following suggestions:

example1.rb: mvaddstr would work (there was a typo)
example2.rb: use different arrays for row and col: row=[];col=[]

> Having read it now, I'm looking for the form2.rb example it mentions.
> (It doesn't seem to be included in the Debian package).

Looks like a packaging oversight. You can get them from the source
package in the meantime, or via ViewCVS:
http://cvs.berlios.de/cgi-bin/viewcvs.cgi/ncurses-ruby/ncurses-ruby...

Tobias