wxWidgets / Phoenix

wxPython's Project Phoenix. A new implementation of wxPython, better, stronger, faster than he was before.
http://wxpython.org/
2.32k stars 519 forks source link

wx.EVT_FULLSCREEN and wx.FullScreenEvent not available on macOS, despite documentation claiming it is #2391

Open davidfstr opened 1 year ago

davidfstr commented 1 year ago

Operating system: macOS 10.14.6 (Mojave) wxPython version & source: 4.1.1 osx-cocoa (phoenix) wxWidgets 3.1.5, from PyPI Python version & source: CPython 3.8.10

Description of the problem:

The documentation for wx.EVT_FULLSCREEN and wx.FullScreenEvent say they are "New in version 4.1/wxWidgets-3.1.5." and thus presumably available in those versions of wxPython/wxWidgets.

However I cannot access either wx.EVT_FULLSCREEN or wx.FullScreenEvent on wxPython 4.1.x / wxWidgets 3.1.5, which makes it impossible for me to listen to fullscreen events on wx.TopLevelWindows on macOS. See the code example below for details.

Is there something special that needs to be done to access these items in the wx module?

Code Example (click to expand) ```bash $ python3 Python 3.8.10 (v3.8.10:3d8993a744, May 3 2021, 08:55:58) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import platform; platform.system() 'Darwin' >>> import wx; wx.version() '4.1.1 osx-cocoa (phoenix) wxWidgets 3.1.5' >>> wx.EVT_FULLSCREEN Traceback (most recent call last): File "", line 1, in AttributeError: module 'wx' has no attribute 'EVT_FULLSCREEN' >>> wx.FullScreenEvent Traceback (most recent call last): File "", line 1, in AttributeError: module 'wx' has no attribute 'FullScreenEvent' >>> ```
swt2c commented 1 year ago

Support for wx.EVT_FULLSCREEN and wx.FullScreenEvent was added in wxPython 4.2.0.

davidfstr commented 1 year ago

Support for wx.EVT_FULLSCREEN and wx.FullScreenEvent was added in wxPython 4.2.0.

@swt2c Perhaps then the following part of the docs should say "New in version 4.2" rather than "New in version 4.1"?

Screen Shot 2023-05-15 at 5 53 38 PM
davidfstr commented 1 year ago

@swt2c Perhaps then the following part of the docs should say "New in version 4.2" rather than "New in version 4.1"?

Can I get a confirmation or a denial?

If this text in the doc is actually incorrect, then I could put together a PR to fix it.

swt2c commented 1 year ago

The docs are wrong, yes. However, fixing that is somewhat complicated to say the least. The docs are automatically generated from the wxWidgets documentation, and so the docs are correct that this event was added in wxWidgets 3.1.5. However, it was NOT added to wxPython when wxPython first moved to wxWidgets 3.1.5, which is where the complication comes in. The wxPython documentation generation code attempts to map these things from wxWidgets versions to wxPython versions, and at the moment, there really isn't anywhere to document exceptions where the mapping isn't correct and needs to be manually changed.

davidfstr commented 1 year ago

The wxPython documentation generation code attempts to map these things from wxWidgets versions to wxPython versions, and at the moment, there really isn't anywhere to document exceptions where the mapping isn't correct and needs to be manually changed.

I see. Are there many known exceptions like wx.EVT_FULLSCREEN where the version of wxPython introduced differs from the version of wxWidgets introduced? Or is wx.EVT_FULLSCREEN a rare exception?

I'm trying to gauge how much value we'd get by making the doc generator be aware of exceptions like wx.EVT_FULLSCREEN, based on how many exceptions that are (known).

swt2c commented 1 year ago

I don't know offhand how many exceptions there are, unfortunately. Personally, I'm not very motivated to work on such a change, given the large number of other open issues.