Popup menu does not seem to give back focus, until I double-click

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Popup menu does not seem to give back focus, until I double-click

Samuel Hornus
Dear list,

macOS High Sierra (10.13.6), wxPython 4.0.3.

The curiosity is present only on MacOS (maybe Linux too; not tested), but on Windows it all works well.

The curiosity:
I have the following GUI hierarchy:
Frame A -> SimpleBook B -> Panel C  -> Window D -> calls PopupMenu()
After selecting a menu item or clicking outside the popup menu, the menu disappears, as it should, *but* nothing happens after that, whenever I click *anywhere* in the top-level Frame A !

It's as if the bottom-level Window D grabs all the clicks and does not react to them.

And even weirder : if I double-click, then all goes back to normal: Clicks on the other UI elements (tabs, tool buttons, ...) react normally again.

A hint that may help : if I invoke the popup N times, then I *have to* double-click N times, anywhere, in order to get back to normal behaviour.
So there seems to be a layering of some invisible Frame/Window/Widget that captures all input and disappears upon double-clicking on it.

I did comment most app-specific code out, so I believe this is a bug in wxWindows, specific to macOS.
Still, lots of code, many files, so I don't have a minimal example; will prepare if necessary.
Any hint would be very much appreciated.
Thank you in advance,
Regards,
SH

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Popup menu does not seem to give back focus, until I double-click

Robin Dunn
On Tuesday, December 4, 2018 at 8:04:08 AM UTC-8, Samuel Hornus wrote:
Dear list,

macOS High Sierra (10.13.6), wxPython 4.0.3.

The curiosity is present only on MacOS (maybe Linux too; not tested), but on Windows it all works well.

The curiosity:
I have the following GUI hierarchy:
Frame A -> SimpleBook B -> Panel C  -> Window D -> calls PopupMenu()
After selecting a menu item or clicking outside the popup menu, the menu disappears, as it should, *but* nothing happens after that, whenever I click *anywhere* in the top-level Frame A !

It's as if the bottom-level Window D grabs all the clicks and does not react to them.

And even weirder : if I double-click, then all goes back to normal: Clicks on the other UI elements (tabs, tool buttons, ...) react normally again.

A hint that may help : if I invoke the popup N times, then I *have to* double-click N times, anywhere, in order to get back to normal behaviour.
So there seems to be a layering of some invisible Frame/Window/Widget that captures all input and disappears upon double-clicking on it.

I did comment most app-specific code out, so I believe this is a bug in wxWindows, specific to macOS.
Still, lots of code, many files, so I don't have a minimal example; will prepare if necessary.

Does the PopupMenu sample in the demo behave the same way for you? (It doesn't for me.) If it doesn't then compare how it creates and uses the popup menu with how you are doing it. If there's still a problem then try to make a small sample that demonstrates the problem. See https://wiki.wxpython.org/MakingSampleApps

--
Robin


--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.