Below is a part of the code used in the app I'm building for my current employment. when the following code is ran, I receive the error stated in the title of this post. The code for the tkinter wizard is pulled from http://mail.python.org/pipermail/tutor/2005-May/038686.html. I've run the code in its own window and it works, but when I place the code in my app it runs into the aforementioned error.
So, here's my question: What is going on, and how can I fix it?
from tkinter import *
#Start Code for the Introduction Wizard
def wizIntro():
wizIntro = tkinter.Tk()
#Title:
wizIntro.title('Welcome to Training')
#Content:
page1 = Frame(wizIntro)
Label(page1, text='', width=110).pack()
Label(page1, text='--Welcome to Training--', width=85).pack()
Label(page1, text='', width=85).pack()
Label(page1, text='This tutorial will help you familiarize yourself with the program. Following it is key to understanding', width=85).pack()
Label(page1, text='the proper operation of the Laser Cutter.', width=85).pack()
Label(page1, text='', width=90).pack()
Label(page1, text='It is also important to follow every insrtuction exactly as stated, to avoid or minimize damage to the Laser', width=85).pack()
Label(page1, text='Cutter and reduce the risk of injury to the operator and those around him.', width=85).pack()
Label(page1, text='Therefore, all safety notices must be followed with extreme care.', width=110).pack()
Label(page1, text='--Failure to follow all safety notices poses a severe risk of damage to the equipment and to the operator, which can be fatal--', width=110, fg='red').pack()
Label(page1, text='', width=110).pack()
Label(page1, text='Click Next to Continue...', width=110).pack()
page1.pack()
page2 = Frame(wizIntro)
Label(page2, text='', width=110).pack()
#Commands:
pages = [page1, page2]
current = page1
def move(dirn):
global current
idx = pages.index(current) + dirn
if not 0 <= idx < len(pages):
return
current = pages[idx]
current.pack_forget()
current.pack(side = TOP)
def nex():
move(+1)
def prev():
move(-1)
Button(wizIntro, text='Previous', command=prev).pack(side = LEFT)
Button(wizIntro, text='Next', command=nex).pack(side = RIGHT)
#End Code for the Introduction Wizard