Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > ncurses howto examples available

Reply
Thread Tools

ncurses howto examples available

 
 
Bauduin Raphael
Guest
Posts: n/a
 
      02-05-2005
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-Pr...WTO/index.html and
transposed it some examples to ruby.

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


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-Pr...TO/panels.html
Menus: http://www.tldp.org/HOWTO/NCURSES-Pr...WTO/menus.html
Forms: http://www.tldp.org/HOWTO/NCURSES-Pr...WTO/forms.html
CDK: http://www.tldp.org/HOWTO/NCURSES-Pr...tools.html#CDK

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

Thanks.

Raph
 
Reply With Quote
 
 
 
 
Tobias Peters
Guest
Posts: n/a
 
      02-06-2005
Bauduin Raphael wrote:
> I put those files available at
> http://www.raphinou.com/rubyncurses-examples.tgz .


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

> Panels: http://www.tldp.org/HOWTO/NCURSES-Pr...TO/panels.html
> Menus: http://www.tldp.org/HOWTO/NCURSES-Pr...WTO/menus.html
> Forms: http://www.tldp.org/HOWTO/NCURSES-Pr...WTO/forms.html
> CDK: http://www.tldp.org/HOWTO/NCURSES-Pr...tools.html#CDK
>
> 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
 
Reply With Quote
 
 
 
 
Bauduin Raphael
Guest
Posts: n/a
 
      02-06-2005
Tobias Peters wrote:
> Bauduin Raphael wrote:
>
>> I put those files available at
>> http://www.raphinou.com/rubyncurses-examples.tgz .

>
>
> Thanks for translating these. I'll have a look soon.
>
>> Panels: http://www.tldp.org/HOWTO/NCURSES-Pr...TO/panels.html
>> Menus: http://www.tldp.org/HOWTO/NCURSES-Pr...WTO/menus.html
>> Forms: http://www.tldp.org/HOWTO/NCURSES-Pr...WTO/forms.html
>> CDK: http://www.tldp.org/HOWTO/NCURSES-Pr...tools.html#CDK
>>
>> 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

 
Reply With Quote
 
Tobias Peters
Guest
Posts: n/a
 
      02-06-2005
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
 
Reply With Quote
 
Simon Strandgaard
Guest
Posts: n/a
 
      02-06-2005
On Sun, 6 Feb 2005 23:55:11 +0900, Tobias Peters
<(E-Mail Removed)-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_shots/057.png


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

--
Simon Strandgaard


 
Reply With Quote
 
Tobias Peters
Guest
Posts: n/a
 
      02-06-2005
>>> http://www.raphinou.com/rubyncurses-examples.tgz .
>> 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/viewcv...ruby/examples/

Tobias
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ncurses.init_pair no longer seems to exist in the 'ncurses' package. Kenneth McDonald Ruby 1 09-27-2008 03:18 AM
RESUME EXAMPLES INFORMATION / CV EXAMPLES NOW AVAILABLE THROUGHRESUMEWRITERGUIDE.COM rawebadvert3 Computer Support 0 03-23-2008 04:19 AM
COVER LETTERS RESUME EXAMPLES AND CV EXAMPLES AVAILABLE CURRICULUM VITAE rawebadvert3 Computer Support 0 08-21-2007 03:07 AM
COVER LETTERS RESUME EXAMPLES AND CV EXAMPLES AVAILABLE rawebadvert3 Computer Support 0 05-25-2007 04:18 AM



Advertisments