I have a bunch of image buttons where if you right click them a ShowPopUpDialog appears. The problem is it doesn't work on the third image. I'm not sure why since I didn't put any "limit" that it shouldn't work on the third image.
You can check an illustration of the problem here:
You can check the illustration file here:
P.S. The problem may or may not be related to this Remove Stray ShowPopUpDialog. If it is, you can close this one.
judging from the video, your popup seems to have some kind of race condition with a native popup menu of Cinema. You can also see it opening on the second element, which is very odd for happening inside a custom dialog. I do not see an obvious reason for this in your code - Message would be the first place to look into. But I also find it a bit hard to read your code due to the lack of documentation and its disregard of PEP8.
There is also a possible problem in your code, depending on how Cinema places the gadgets - if it places some kind of padding between them. You test in is_position_on_gadget for a hit condition with:
if not buttonData["x"] < x < buttonData["x"] + buttonData["w"]:
if not buttonData["y"] < y < buttonData["y"] + buttonData["h"]:
When the gadgets are placed like [0, 100], [100, 200] ..., where each bracket group denotes the start and end of a gadget, then you cannot distinguish between two neighbouring elements with your code if I am not overlooking something.
[0, 100], [100, 200] ...
Probably not very helpful all together, but I am too tired for more right now
Finding out the
Thanks for the response.
You are right. It should have worked if there is padding between buttons.
For now, I just chose either buttonData["w"] or buttonData["h"].
And it works as expected.
RE: hard to read your code due to the lack of documentation and its disregard of PEP8
Sorry about that.