From: Paul Duncan Date: 2005-12-13T06:43:56+09:00 Subject: Re: Ncurses - how do you get mousemask working? --CxDuMX1Cv2n9FQfo Content-Type: multipart/mixed; boundary="o7gdRJTuwFmWapyH" Content-Disposition: inline --o7gdRJTuwFmWapyH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Paul Duncan (pabs@pablotron.org) wrote: > * Richard Lyman (lymans@gmail.com) wrote: > > I've tried... and I've looked around. > >=20 > > A few other projects have the line with 'Ncurses::mousemask...' in > > them - but it's always commented out... like they couldn't get it > > working either. >=20 > They couldn't >=20 > > Is this feature not functional? >=20 > It's a bug in the method definition; see below. >=20 > > I've currently got 'Ncurses::mousemask(Ncurses::ALL_MOUSE_EVENTS,[])' > > and the error 'wrong number of arguments (2 for 1)' and as soon as I > > drop the second arg I get the error 'oldmask (2nd argument) must be an > > empty Array' which is kinda bothersome... :-) >=20 > It's a bug in the library. It's been there forever (I came across it > when I was trying to add mouse support to Raggle, then just forgot to > send a patch upstream). >=20 > > Any hints? Tobias? Err, my patch is backwards... Here's the correct one (again, attached): diff -ur ncurses-ruby-0.9.2/ncurses_wrap.c ncurses-ruby-0.9.2-mousemask_fix= /ncurses_wrap.c --- ncurses-ruby-0.9.2/ncurses_wrap.c 2005-02-26 19:22:13.000000000 -0500 +++ ncurses-ruby-0.9.2-mousemask_fix/ncurses_wrap.c 2005-12-12 16:42:11.000= 000000 -0500 @@ -2387,7 +2387,7 @@ NCFUNC(ungetmouse, 1); #endif #ifdef HAVE_MOUSEMASK - NCFUNC(mousemask, 1); + NCFUNC(mousemask, 2); #endif #ifdef HAVE_WENCLOSE rb_define_module_function(mNcurses, "wenclose?", > Apply this patch (also attached): >=20 > diff -ur ncurses-ruby-0.9.2/ncurses_wrap.c ncurses-ruby-0.9.2-mousemask/n= curses_wrap.c > --- ncurses-ruby-0.9.2/ncurses_wrap.c 2005-12-12 16:33:00.000000000 -0500 > +++ ncurses-ruby-0.9.2-mousemask/ncurses_wrap.c 2005-02-26 19:22:13.00000= 0000 -0500 > @@ -2387,7 +2387,7 @@ > NCFUNC(ungetmouse, 1); > #endif > #ifdef HAVE_MOUSEMASK > - NCFUNC(mousemask, 2); > + NCFUNC(mousemask, 1); > #endif > #ifdef HAVE_WENCLOSE > rb_define_module_function(mNcurses, "wenclose?", >=20 >=20 > --=20 > Paul Duncan pabs in #ruby-lang (OPN IRC) > http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562 > diff -ur ncurses-ruby-0.9.2/ncurses_wrap.c ncurses-ruby-0.9.2-mousemask/n= curses_wrap.c > --- ncurses-ruby-0.9.2/ncurses_wrap.c 2005-12-12 16:33:00.000000000 -0500 > +++ ncurses-ruby-0.9.2-mousemask/ncurses_wrap.c 2005-02-26 19:22:13.00000= 0000 -0500 > @@ -2387,7 +2387,7 @@ > NCFUNC(ungetmouse, 1); > #endif > #ifdef HAVE_MOUSEMASK > - NCFUNC(mousemask, 2); > + NCFUNC(mousemask, 1); > #endif > #ifdef HAVE_WENCLOSE > rb_define_module_function(mNcurses, "wenclose?", --=20 Paul Duncan pabs in #ruby-lang (OPN IRC) http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562 --o7gdRJTuwFmWapyH Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ncurses-ruby-0.9.2-mousemask_fix.diff" diff -ur ncurses-ruby-0.9.2/ncurses_wrap.c ncurses-ruby-0.9.2-mousemask_fix/ncurses_wrap.c --- ncurses-ruby-0.9.2/ncurses_wrap.c 2005-02-26 19:22:13.000000000 -0500 +++ ncurses-ruby-0.9.2-mousemask_fix/ncurses_wrap.c 2005-12-12 16:42:11.000000000 -0500 @@ -2387,7 +2387,7 @@ NCFUNC(ungetmouse, 1); #endif #ifdef HAVE_MOUSEMASK - NCFUNC(mousemask, 1); + NCFUNC(mousemask, 2); #endif #ifdef HAVE_WENCLOSE rb_define_module_function(mNcurses, "wenclose?", --o7gdRJTuwFmWapyH-- --CxDuMX1Cv2n9FQfo Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFDne8VzdlT34LClWIRAiJPAJ0UVgMRIAzGIqZP7nAnfv1q614+qwCfUwlW JatCBQt38SWXpeZ0YBlUQrg= =Hsul -----END PGP SIGNATURE----- --CxDuMX1Cv2n9FQfo--