This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Marc.Culler
Recipients Marc.Culler, culler, ned.deily, remyrfouquette, ronaldoussoren
Date 2022-02-02.20:36:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CALcZXRESqgx7beOAsPJdTqu4+_zrBBOQWL42CcLOAZ_SQJKKqg@mail.gmail.com>
In-reply-to <1643831661.5.0.66468371961.issue46573@roundup.psfhosted.org>
Content
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 <report@bugs.python.org> wrote:

>
> Ned Deily <nad@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 <report@bugs.python.org>
> <https://bugs.python.org/issue46573>
> _______________________________________
>
History
Date User Action Args
2022-02-02 20:36:04Marc.Cullersetrecipients: + Marc.Culler, ronaldoussoren, ned.deily, culler, remyrfouquette
2022-02-02 20:36:04Marc.Cullerlinkissue46573 messages
2022-02-02 20:36:04Marc.Cullercreate