This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Hênio Tierra Sampaio
Recipients Hênio Tierra Sampaio
Date 2020-03-19.01:45:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1584582357.44.0.253053056041.issue40011@roundup.psfhosted.org>
In-reply-to
Content
I'm maintainer for a project for the RaspberryPi, a GUI for OMXPlayer called TBOPlayer. This GUI was originally made for Python 2, but with Python 2 deprecation, I decided to convert it to Python 3. After (supposedly) converting all of it I had a surprise to see that the events that worked in the original code with Python 2 didn't work anymore in Python 3 with errors like

    File "/home/henio/Projetos/tboplayer/lib/tboplayer.py", line 1566, in select_track
    sel = event.widget.curselection()
    AttributeError: 'tuple' object has no attribute 'widget'


And upon investigation, I noticed all the widget events (originally of type tkinter.Event) were now of type Tuple. WTF. Ok, I tried to circumvent this by using the tuple "attributes", like, in the event

    (('17685', '1', '??', '??', '??', '256', '59467466', '??', '212', '11', '??', '0', '??', '??', '.!listbox', '5', '1030', '344', '??'),)

I can access the x position of the cursor in relation to the widget by doing:

    event[0][8]

Which I did. However, I obviously cannot use any of the Event methods, and this way I cannot get the current selection from a Listbox, for example, and trying to gives me the exact error mentioned above. This renders TBOPlayer useless as the user cannot even select a track for playing.

I could circumvent this specific problem by keeping track of the previous clicked position over the Listbox and do a simple math calculation to get the current list item, but that's is very annoying, and not the right way to do it, meaning it would make the code more complex than it should be, and making maintaing more difficult.

And unfortunately, I was unable to reproduce this issue with a minimum code, so I have no idea what's going on.

This issue comment describes how to reproduce the bug inside of TBOPlyaer: https://github.com/KenT2/tboplayer/issues/175#issuecomment-600861514
History
Date User Action Args
2020-03-20 08:26:52ned.deilyunlinkissue40011 messages
2020-03-19 01:45:57Hênio Tierra Sampaiosetrecipients: + Hênio Tierra Sampaio
2020-03-19 01:45:57Hênio Tierra Sampaiosetmessageid: <1584582357.44.0.253053056041.issue40011@roundup.psfhosted.org>
2020-03-19 01:45:57Hênio Tierra Sampaiolinkissue40011 messages
2020-03-19 01:45:57Hênio Tierra Sampaiocreate