Curses

Is anyone using the Curses class?
Is anyone maintaining the Curses class?

It looks like the Curses function move(y,x) is calling the wrong library
routine.

It is calling the window move function and not the cursor positioning
function.

Thanks,
Sam Overdorf

Overdorf, Sam wrote:

Sam Overdorf

According to O’Reilly’s Programming with Curses “move() is really a
#define macro for wmove() which takes a WINDOW* as its first argument.”
So it appears that the library is working correctly.

On Sep 26, 2006, at 9:03 PM, Overdorf, Sam wrote:

Is anyone using the Curses class?

You could look at

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/201932

to see a project that I recently did with Curses.

Regards, Morton

On 2006.09.27 10:35, Michael W. Ryder wrote:

Thanks,
Sam Overdorf

According to O’Reilly’s Programming with Curses “move() is really a
#define macro for wmove() which takes a WINDOW* as its first argument.”
So it appears that the library is working correctly.

#setpos x, y

Eero S. wrote:

Thanks,
Sam Overdorf

According to O’Reilly’s Programming with Curses “move() is really a
#define macro for wmove() which takes a WINDOW* as its first argument.”
So it appears that the library is working correctly.

#setpos x, y

What flavor of Curses is this from?

Eero S. wrote:

It is calling the window move function and not the cursor positioning

This one:

http://www.ruby-doc.org/stdlib/libdoc/curses/rdoc/classes/Curses.html

The source code shows that it uses Curses’ move() function which is a
macro to wmove() as I described above.

On 2006.09.27 15:45, Michael W. Ryder wrote:

function.
What flavor of Curses is this from?
This one:

http://www.ruby-doc.org/stdlib/libdoc/curses/rdoc/classes/Curses.html

On 2006.09.28 04:25, Michael W. Ryder wrote:

routine.
#setpos x, y
What flavor of Curses is this from?

This one:

http://www.ruby-doc.org/stdlib/libdoc/curses/rdoc/classes/Curses.html

The source code shows that it uses Curses’ move() function which is a
macro to wmove() as I described above.

No, move() moves the cursor (wmove() moves a specified window’s cursor).

Confusingly, Ruby’s Curses bindings also have a .move which actually
uses mvwin() which moves the window itself.

On 2006.09.28 07:30, Michael W. Ryder wrote:

It looks like the Curses function move(y,x) is calling the wrong
#define macro for wmove() which takes a WINDOW* as its first
No, move() moves the cursor (wmove() moves a specified window’s cursor).

Confusingly, Ruby’s Curses bindings also have a .move which actually
uses mvwin() which moves the window itself.

ALL input/output in Curses is done with windows. The only difference
between move() and wmove() is that move() passes the current window to
the wmove() function. When you first start Curses it creates a window
and sets it as the current window. Unless you create another window and
change to it this window is used for all I/O.

Which is exactly what I said. Please review the Curses documentation.

http://www.die.net/doc/linux/man/man3/move.3.html
http://www.die.net/doc/linux/man/man3/mvwin.3.html

Eero S. wrote:

library
So it appears that the library is working correctly.

Confusingly, Ruby’s Curses bindings also have a .move which actually
uses mvwin() which moves the window itself.

ALL input/output in Curses is done with windows. The only difference
between move() and wmove() is that move() passes the current window to
the wmove() function. When you first start Curses it creates a window
and sets it as the current window. Unless you create another window and
change to it this window is used for all I/O.

On 2006.09.28 07:35, Eero S. wrote:

According to O’Reilly’s Programming with Curses "move() is really a

Which is exactly what I said. Please review the Curses documentation.

http://www.die.net/doc/linux/man/man3/move.3.html
http://www.die.net/doc/linux/man/man3/mvwin.3.html

And yes, Ruby’s Curses.move is not the same as move(). Curses.move
is the same as mvwin(). Curses.setpos is the same as move().

Eero S. wrote:

Is anyone maintaining the Curses class?

No, move() moves the cursor (wmove() moves a specified window’s cursor).
http://www.die.net/doc/linux/man/man3/move.3.html
http://www.die.net/doc/linux/man/man3/mvwin.3.html

And yes, Ruby’s Curses.move is not the same as move(). Curses.move
is the same as mvwin(). Curses.setpos is the same as move().

Having programmed using Curses with C for many years I am familiar with
how Curses works. As I kept pointing out move() and wmove() are the
same function. Why the Ruby library uses different names for the
functions I do not know. The mvwin() command in original Curses moves
the top left corner of the window, not the cursor position as one would
expect with a name like Curses.move. Personally, if I were using the
library I would have to rename all of the functions to their proper
Curses representation, not some random name like seems to have been
used. The current names makes it impossible to use available programs
and documentation with the Ruby library.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs