Ncurses like library?

T

Tim Mcd

Excuse me, but does anyone know of an Ncurses-like library for Ruby? For
putting graphics made with static text onto a terminal/DOS window?
 
T

Tim Mcd

Andy said:
Why is it that site never gets old?
Especially when it comes to the 2-3 Ncurses questions a day.

Yeah, that ruby-ncurses binding isn't the best, lots of methods are
missing and other little things (like 'include Ncurses' not working
correctly). Any OTHER TUI libraries?
 
M

Michal Suchanek

2009/1/14 Tim Mcd said:
Yeah, that ruby-ncurses binding isn't the best, lots of methods are
missing and other little things (like 'include Ncurses' not working
correctly). Any OTHER TUI libraries?

If you look through the forum somebody suggested curses FFI bindings I
think but I don't know how far that got.

If you find the ruby curses bindings insufficient, post about its
deficiencies so that they can be worked out.

I personally do not use them because they cannot do multibyte
characters but that's not limitation of these bindings but of the
version 1.8 of the Ruby interpreter - it cannot use locales correctly.

Thanks

Michal
 
T

Tim Mcd

Michal said:
If you look through the forum somebody suggested curses FFI bindings I
think but I don't know how far that got.
I'll look into that, thanks.
If you find the ruby curses bindings insufficient, post about its
deficiencies so that they can be worked out.
I thought Ruby-Ncurses development was dead?
 
J

Jesús Gabriel y Galán

Yeah, that ruby-ncurses binding isn't the best, lots of methods are
missing and other little things (like 'include Ncurses' not working
correctly). Any OTHER TUI libraries?

Sorry, from the way you worded your question I assumed you wanted to
know if there were any ruby ncurses bindings and I wanted to point out
that some googling might help (admiteddly, I should have clicked the
search, and not the "I'm feeling lucky" button, to show there were
many results). You didn't show that you had already evaluated some
ncurses binding, so I assumed you didn't. My bad.

From the questions in this list it seems there are other people using
the ncurses gem. For example Nit Khair posted many questions related
to ncurses, maybe you can take a look at his questions. Also Sean
O'Halpin was working in a FFI wrapper for ncurses which might be
interesting.

Jesus.
 
T

Tim Mcd

Jesús Gabriel y Galán said:
Sorry, from the way you worded your question I assumed you wanted to
know if there were any ruby ncurses bindings and I wanted to point out
that some googling might help (admiteddly, I should have clicked the
search, and not the "I'm feeling lucky" button, to show there were
many results). You didn't show that you had already evaluated some
ncurses binding, so I assumed you didn't. My bad.

From the questions in this list it seems there are other people using
the ncurses gem. For example Nit Khair posted many questions related
to ncurses, maybe you can take a look at his questions. Also Sean
O'Halpin was working in a FFI wrapper for ncurses which might be
interesting.

Jesus.

http://search.cpan.org/~lunartear/Term-Visual-0.08/Visual.pm
Looks absolutely perfect. I can't find anything related to getting it to
work with Ruby, save for a post asking how to do it here on this list.
No one replied to it. Anyone ever get it to work?
 
R

Ruby Rabbit

Tim said:
Excuse me, but does anyone know of an Ncurses-like library for Ruby? For
putting graphics made with static text onto a terminal/DOS window?

I am surprised to hear that ncurses-ruby is not working or the include
Ncurses is not working.

All my work uses ruby-ncurses as a base. Yes, there are a couple of
things I have come across that were buggy - which I have pointed out on
this forum.
Sadly there seems to be no maintainer for it -- have posted bugs but no
response. But these are very minor and probably no one uses those
things.

Please install the gem and then try the samples. Feel free to ask me
anything - I just might be able to help and save you time, and am glad
to answer.

oh, btw, just wondering -- is the basic curses that comes with ruby
working on your system.

Also, I believe I have done extensive and thorough searching on ncurses
and ruby (2 months ago) and whatever libraries or wrappers I could find
were long abandoned or had not released code.

Cheers,
Sent.
 
M

Michal Suchanek

2009/1/14 Tim Mcd said:
I'll look into that, thanks.

I thought Ruby-Ncurses development was dead?

I meant the ruby curses extension that is included in stdlib.

It is probably not developed very actively but if you find some
limitations that can be resolved without introducing incompatibilities
(or in any reasonable way for 1.9) there is a good chance that such
change will be included.

Thanks

Michal
 
P

Phlip

Ruby said:
All my work uses ruby-ncurses as a base.

Can you use it in an existing console, such as to simply color text, without
pretending it's a window and taking over all of it?
 
M

Michal Suchanek

2009/1/15 Phlip said:
Can you use it in an existing console, such as to simply color text, without
pretending it's a window and taking over all of it?

I guess that's not what curses are meant for in general.

You can look up the terminal capabilities and use them to change
colors but curses functions all operate on windows. Curses is a TUI
library, not an output coloring library.

The situation is further complicated on Windows where the 'console' is
very fishy and normally you cannot change the colors with writing
terminal strings, only with Win32API calls.

Thanks

Michal
 
R

Ruby Rabbit

Phlip said:
Can you use it in an existing console, such as to simply color text,
without
pretending it's a window and taking over all of it?

I am not exactly certain of what you mean, but have you tried Highline.

It does great coloring, I have run its demos but not really used it. A
lot of people here have used it.

Also, iirc Facets has some module for ANSI-coloring. If i am not
mistaken you can do something like a colored ls output (directory
listing).

So do a give a look at Highline and Facets.
 
T

Tj Holowaychuk

RK said:
Looks really good!

Thanks! that was my first Ruby library every actually haha, its still a
work in progress but all the major tasks seem pretty solid now, just not
alot of people know about it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,183
Messages
2,570,965
Members
47,513
Latest member
JeremyLabo

Latest Threads

Top