Access to window controller is broken?

I’m writing a palette plugin using the PyObjC approach – the documentation and the samples are great. However, I couldn’t figure out how to access the window controller. So I gave the Smiley Panel Plugin a try and I encountered the same issue there, the plugin causes a crash (because windowController() returns nothing).

Any help would be most welcome, thanks!

I’m using Glyphs 3.1.2 (Python 3.9.1) on macOS Ventura 13.4.

I updated the Smile plugin.

Thank you for looking into this so quickly! It helped me a lot to understand the original problem — it was a timing issue after all. I’m not trying to access the window controller directly in the start method anymore but wait for the event of the DOCUMENTOPENED observer to fire.