possible Mac mouse bug

35 views
Skip to first unread message

greg swift

unread,
May 15, 2015, 4:16:59 PM5/15/15
to vpytho...@googlegroups.com
from visual.controls import *
from visual import rate

def swapColor(): # click the button to change its color
    if butt.button.color == color.red: butt.button.color = color.cyan
    else: butt.button.color = color.red

display()
controls()
butt = button(text='button', color=color.red, action=lambda:swapColor())

while True: rate(100)

# This always works in my Windows 7 computer, which has
#     python 2.7.6 (this is 32 bit, windows X86 msi installer)
#     and VPython-Win-Py2.7-5.74

# However, on a Mac OSX 10.7.5, it is intermittent:
#     Sometimes the color does not change.
#     This Mac has "python 2.7.9 for mac 0sx 10.6 and higher"
#     and then vpython-mac-py2.7-6.11, then ActiveTcl.
#     (To make vpython work with py2app, I've eliminated tga stuff.)

# On the Mac, to make it misbehave EVERY time, go to Mac Preferences,
#    Mouse, and set the double-click speed as slow as possible.
# You will see that the first click changes the button color, but
#    if the mouse is not moved and you click a second time the color
#    is not changed.  But move the mouse off the button, then move it
#    back onto the button, and then click---it's ok every time.


Steve Spicklemire

unread,
May 15, 2015, 4:55:28 PM5/15/15
to vpytho...@googlegroups.com
I'll look into it!  thanks for the report.

thanks,
-steve
--
You received this message because you are subscribed to the Google Groups "VPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vpython-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steve Spicklemire

unread,
May 16, 2015, 7:01:36 AM5/16/15
to vpytho...@googlegroups.com, Steve Spicklemire
Hi Greg,

I do see the behavior you describe. I’m curious, have you tried a VPython 6.x for windows?

I’ve found that if I wait between clicks it works, but if I click again too soon, it fails. I’ll check into the handling of click events and look for a timing problem of some kind.

thanks,
-steve

On May 15, 2015, at 2:16 PM, greg swift <sw...@lanl.gov> wrote:
>
>

greg swift

unread,
May 17, 2015, 10:39:08 PM5/17/15
to vpytho...@googlegroups.com
Hi Steve,
Sorry, I haven't tried 6.x in Windows.  (Am 99% done with a project and afraid to break something I might not be smart enough to fix.)
Thanks for taking a look at this. 
Greg
Reply all
Reply to author
Forward
0 new messages