Python2.0 and Pmw 0.8.4 counter problem

Richard Townsend NOstarfighterSPAM at freeuk.com
Fri Jan 26 17:29:36 EST 2001


>     We used Python1.5 with Pmw 0.8.3 to develop an in-house application.
For some
> reasons, we changed to Python2.0 and we decided to use the new Pmw version
(
> 0.8.4 ).  In our application, we have a Pmw.Counter of integers and it
doesn't work
> anymore.  The behaviour is strange :  if we type a new integer in the
entry field,
> everything is fine.  But using the arrows ( left or right, up or down )
just clean
> the entry field, without updating its content.  I try the demos in the Pmw
> distributions and they don't work either.  We installed Python1.6 with Pmw
0.8.3, and
> it still doesn't work !!!  I tried all the other types of counters and
they all work
> fine, but the integer.
>
>     Anybody has a suggestion ?
>

I posted the same question a few months ago and got the following solution
from Roberto Amorim

> Hi, to correct it is simple. You'll have to edit PmwCounter.py. Here it
> is:
>
> - Find the function called _changeNumber() (line 273)
> - On line 279 there's the return statement for this function. Change it
> to return str(value) (and not return str(value)[:-1])
>
> That ocurred because str(long) on Python 2.0 doesn't return a number
> with L on the end like Python 1.5.2 did.
>

regards,
Richard Townsend






More information about the Python-list mailing list