Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
IRC like interface
Juergen Fiedler
1/4/2006 4:44:00 PM
Hi,
I would like to try to write a text based Jabber client in Ruby, but
being that I am rather new to it, I am running into problems already:
I would like a text based user interface that looks somewhat like the
classic IRC clients: An input line at the bottom of the screen with the
rest of the screen being available for asyncronous output.
If at all possible, I would also like to support the readline library
for text input.
I figured I would use curses to keep input and output separated,
maintaining a separate cursor position for text that is typed in and for
text that comes in over a socket, for example. I have no idea, though,
how to get readline into the equation - and even without that, I am not
sure whether my approach would be really ideal.
Is there any easy to understand example code out there that would
illustrate how to program a simple chat client with a text based user
interface?
Any input would be much appreciated.
Thanks,
-juergen
--
Posted via
http://www.ruby-...
.
3 Answers
Chad Perrin
1/4/2006 9:24:00 PM
0
On Thu, Jan 05, 2006 at 01:44:24AM +0900, Juergen Fiedler wrote:
> I figured I would use curses to keep input and output separated,
> maintaining a separate cursor position for text that is typed in and for
> text that comes in over a socket, for example. I have no idea, though,
> how to get readline into the equation - and even without that, I am not
> sure whether my approach would be really ideal.
> Is there any easy to understand example code out there that would
> illustrate how to program a simple chat client with a text based user
> interface?
I don't know of Ruby projects of that sort, off the top of my head, but
there's an open source multiprotocol IM client called centericq that
might at least give you some vague ideas. Without double-checking, I
seem to recall that it was written in Perl, though for all I know right
now it could be C. I know it uses ncurses, at least.
--
Chad Perrin [ CCD CopyWrite |
http://ccd.ap...
]
"A script is what you give the actors. A program
is what you give the audience." - Larry Wall
Juergen Fiedler
1/4/2006 9:39:00 PM
0
Chad Perrin wrote:
[...]
> I don't know of Ruby projects of that sort, off the top of my head, but
> there's an open source multiprotocol IM client called centericq that
> might at least give you some vague ideas. Without double-checking, I
> seem to recall that it was written in Perl, though for all I know right
> now it could be C. I know it uses ncurses, at least.
Centericq is what I use when I don't play with new Jabber clients. It is
in fact C these days and an 'ldd /usr/bin/centericq' gives me a very
long list ending with
> libkitchensink.so.11 => /usr/lib/libkitchensink.so.11 (0xb782a000)
yet it does not appear to use libreadline.
One program that uses both is freetalk, a pure Jabber client - but I
find the C source (which relies heavily on callbacks) rather hard to
follow.
Thanks for the input,
--j
--
Posted via
http://www.ruby-...
.
Chad Perrin
1/5/2006 2:31:00 AM
0
On Thu, Jan 05, 2006 at 06:39:26AM +0900, Juergen Fiedler wrote:
> Chad Perrin wrote:
> [...]
> > I don't know of Ruby projects of that sort, off the top of my head, but
> > there's an open source multiprotocol IM client called centericq that
> > might at least give you some vague ideas. Without double-checking, I
> > seem to recall that it was written in Perl, though for all I know right
> > now it could be C. I know it uses ncurses, at least.
>
> Centericq is what I use when I don't play with new Jabber clients. It is
> in fact C these days and an 'ldd /usr/bin/centericq' gives me a very
> long list ending with
I get a list of 27 different dependencies, myself.
>
> > libkitchensink.so.11 => /usr/lib/libkitchensink.so.11 (0xb782a000)
I'd be highly amused if I saw something called "libkitchensink" in
there, though I'd be far less surprised to see it for a KDE application.
>
> yet it does not appear to use libreadline.
Now that I'm actually looking at it, you're right.
Sorry I wasn't more helpful. That was the closest comparison that came
to mind.
--
Chad Perrin [ CCD CopyWrite |
http://ccd.ap...
]
"Real ugliness is not harsh-looking syntax, but having to
build programs out of the wrong concepts." - Paul Graham
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
IRC like interface
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password