Curses

O

Overdorf, Sam

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
 
M

Michael W. Ryder

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

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.
 
E

Eero Saynatkari

--VrqPEDrXMn8OVzN4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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

#setpos x, y

--VrqPEDrXMn8OVzN4
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFGe2Y7Nh7RM4TrhIRAqUoAKDeT0nfv+TALUZKgOvfBUIkgckLOACgyl+A
ULTabBHezBDEXL9apyRk0do=
=o7vC
-----END PGP SIGNATURE-----

--VrqPEDrXMn8OVzN4--
 
E

Eero Saynatkari

--tNQTSEo8WG/FKZ8E
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

=20
What flavor of Curses is this from?

This one:

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

--tNQTSEo8WG/FKZ8E
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFGsx+7Nh7RM4TrhIRAgOcAJ9UcsbwKlSknNlWJWDyEPsGP4yzwQCg6ufM
P7EDNeDAiscxyAJsn/V5WTg=
=Puhs
-----END PGP SIGNATURE-----

--tNQTSEo8WG/FKZ8E--
 
E

Eero Saynatkari

--fwqqG+mf3f7vyBCB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

=20
=20
The source code shows that it uses Curses' move() function which is a=20
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.

--fwqqG+mf3f7vyBCB
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFGuWA7Nh7RM4TrhIRAj1VAJ4vXqX3Oblbn6npfGgbRI9MKvH5dACeJJN8
qIKvl//VZqFQ/Ye4wpJJ+Jw=
=760Q
-----END PGP SIGNATURE-----

--fwqqG+mf3f7vyBCB--
 
M

Michael W. Ryder

Eero said:
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.
 
E

Eero Saynatkari

--h3LYUU6HlUDSAOzy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

=20
ALL input/output in Curses is done with windows. The only difference=20
between move() and wmove() is that move() passes the current window to=20
the wmove() function. When you first start Curses it creates a window=20
and sets it as the current window. Unless you create another window and= =20
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

--h3LYUU6HlUDSAOzy
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFGvxA7Nh7RM4TrhIRAgXsAKCVcDpz0ssd9pBVVPR7lCF/h+ATcwCdGdxY
aLz2IVFjLH6zbW8N617ONeo=
=Cexe
-----END PGP SIGNATURE-----

--h3LYUU6HlUDSAOzy--
 
E

Eero Saynatkari

--MPkR1dXiUZqK+927
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

=20
Which is exactly what I said. Please review the Curses documentation.
=20
http://www.die.net/doc/linux/man/man3/move.3.html
http://www.die.net/doc/linux/man/man3/mvwin.3.html
=20
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().



--MPkR1dXiUZqK+927
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFGv2m7Nh7RM4TrhIRAsb2AKCgNIiUgGQiqZB4FaNiRhmgPc97wgCgugiu
js+zQFXsNIf5K5iXfnQAg+o=
=WHFS
-----END PGP SIGNATURE-----

--MPkR1dXiUZqK+927--
 
M

Michael W. Ryder

Eero said:
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.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top