import Tkinter
import tkMessageBox
def created():
tkMessageBox.showinfo('File Created!', 'Letter.html Created on Desktop')
class simpleapp_tk(Tkinter.Tk):
def __init__(self,parent):
Tkinter.Tk.__init__(self,parent)
self.parent = parent
self.initialize()
def initialize(self):
self.grid()
# --- Everything Fine Here ---
self.B = Tkinter.Button(self, text = 'Create Document', command = self.OnButtonClick)
self.B.grid(column = 0, row = 6)
def OnButtonClick(self):
created()
if __name__ == "__main__":
app = simpleapp_tk(None)
app.title('Receipt Form')
app.iconbitmap(os.getcwd() + '/M.tiff')
app.mainloop()
I use py2app to create a standalone application with this, but when I run it and press the button, it seems to crash.
I am very certain it is tkMessageBox that is causing the problem but the message box works perfectly fine in IDLE.
It also worked fine on my Windows 10 computer with pyinstaller.