from vanilla import *
class WindowDemo(object):
def __init__(self):
self.w = FloatingWindow((200, 70), "Window Demo")
self.w.myButton = Button((10, 10, -10, 20), "My Button")
self.w.button = Button((10, 10, -10, 20), "A Button",
callback=self.buttonCallback)
self.w.open()
def buttonCallback(self, sender):
aString = "/a/b /c/d /eth/a /b/c"
Glyphs.currentDocument.windowController().addTabWithString_(aString)
WindowDemo()
The above script runs, the one below crashes, the only difference is one is using Window:
from vanilla import *
class WindowDemo(object):
def __init__(self):
self.w = Window((200, 70), "Window Demo")
self.w.myButton = Button((10, 10, -10, 20), "My Button")
self.w.button = Button((10, 10, -10, 20), "A Button",
callback=self.buttonCallback)
self.w.open()
def buttonCallback(self, sender):
aString = "/a/b /c/d /eth/a /b/c"
Glyphs.currentDocument.windowController().addTabWithString_(aString)
WindowDemo()
Why? I want to use a normal window so I can minimise my script
And is there a way to stop Glyphs App crashing so that I can see the error message…?