schriftgestalt / GlyphsSDK

Scripting SDK for Glyphs
Apache License 2.0
89 stars 37 forks source link

Can’t access `self.windowController()` from GeneralPlugin (Python) #63

Closed Mark2Mark closed 2 years ago

Mark2Mark commented 2 years ago

In a GeneralPlugin (created from the Plugin Maker) I can’t access the windowController as the sample "Smiley Palette" shows.

self.windowController(): object has no attribute 'windowController'

Other Plugins (by mekkablue also use it, but they are of a different type. Is that an issue with the GeneralPlugin type? And how to solve it?

schriftgestalt commented 2 years ago

GeneralPlugin has no windowcontroller. The panel plugin does have it (as there is an instance of the plugin per window). The GeneralPlugin needs to get to the windows by [NSApp mainWindow], [NSApp currentFontDocument]; or [NSApp orderedDocuments].

Mark2Mark commented 2 years ago

Thanks a lot! Will also add this to the Sample Plugin as a comment.