Message412349
I've done some more research and this is an integration issue between pyglet and Tk. In particular:
* Both pyglet and Tk use AppKit to implement their GUI
* AppKit uses an NSApplication class, and in particular a singleton instance of that class, to represent the application, which will get instantiated during application startup
* The Tk library uses a sublclass of NSApplication with additional functionality (TkApplication).
* When pyglet is started first the NSApplication singleton is an instance of NSApplication and not of TkApplication, but Tk's implementation assumes that the singleton is an instance of TkApplicationo.
A workaround for this issue is to make sure Tk is initialised before initialising pyglet. For example using this code at the start of the script: "from tkinter import Tk; root = Tk()"
There's not much we can do about this in CPython, other than maybe filing an issue with the Tk project about this. I haven't looked at the Tk codebase and there cannot tell how hard it would be for then to avoid a dependency on TkApplication as a separate class (for example by implementing the additional functionality they need in a category on NSApplication). |
|
Date |
User |
Action |
Args |
2022-02-02 10:11:45 | ronaldoussoren | set | recipients:
+ ronaldoussoren, ned.deily, remyrfouquette |
2022-02-02 10:11:45 | ronaldoussoren | set | messageid: <1643796705.69.0.625208248977.issue46573@roundup.psfhosted.org> |
2022-02-02 10:11:45 | ronaldoussoren | link | issue46573 messages |
2022-02-02 10:11:45 | ronaldoussoren | create | |
|