Marc Culler <marc.cul...@gmail.com> added the comment:
The TKApplication class is a subclass of NSApplication which adds both attributes and methods. Those are used throughout the macOS port of Tk, and as Ronald says, the unique instance of NSApplication in Tk is actually a TKApplication. Every macOS Application must have a unique NSApplication object which is referenced by the global variable NSApp. The TKApplication subclass was part of the first Cocoa port of Tk, long before I became involved, and it may have even been there in the Carbon days. Subclassing NSApplication appears to be something that Apple expects. I don't know enough about Categories to understand how they could be used to solve this problem. Do they somehow make it possible to add new methods and attributes to an existing NSApplication object at runtime? I have always thought of them as being syntactical in nature, as opposed to allowing runtime modifications of an object's class after the object has been instantiated. But I am not an expert on Categories by any means. - Marc On Wed, Feb 2, 2022 at 1:54 PM Ned Deily <rep...@bugs.python.org> wrote: > > Ned Deily <n...@python.org> added the comment: > > Thanks for looking into this, Ronald. Before we close this as a Python > issue, perhaps Marc might have a suggestion on what should be done here > from a Tk perspective. > > ---------- > nosy: +culler > status: pending -> open > > _______________________________________ > Python tracker <rep...@bugs.python.org> > <https://bugs.python.org/issue46573> > _______________________________________ > ---------- nosy: +Marc.Culler _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46573> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com