Hi, I am writing a program, in which everything interesting happens in a Toplevel window that I have made. However, whenever I run the program, I get both the standard Tk window and the Toplevel window that I made. How do I get rid of the first Tk window, without closing out of the program completely?
Thanks
Thanks
Code:
#Merthe's Ellipse Adjustment Program February 2012
import numpy
import scipy
from Tkinter import *
import tkFileDialog as tkf
filenames = {}
class App:
def __init__(self, master):
top = Toplevel()
top.title("Adjust Ellipse")
self.top = top
self.L0 = Label(top, text = "Initial Data:").grid(row=0,column=0, sticky=E)
self.L1 = Label(top, text = "After Change #1:").grid(row=1,column=0, sticky=E)
self.L2 = Label(top, text = "After Change #2:").grid(row=2,column=0, sticky=E)
self.L3 = Label(top, text = "Current State:").grid(row=3,column=0, sticky=E)
self.Name0 = Entry(top, state = "readonly", width=40).grid(row=0,column=1, sticky=W,columnspan=3)
self.Name1 = Entry(top, state = "readonly", width=40).grid(row=1,column=1, sticky=W,columnspan=3)
self.Name2 = Entry(top, state = "readonly", width=40).grid(row=2,column=1, sticky=W,columnspan=3)
self.Name3 = Entry(top, state = "readonly", width=40).grid(row=3,column=1, sticky=W,columnspan=3)
self.Butt0 = Button(top, text = "Select", command=self.openfile0).grid(row=0,column=4)
self.Butt1 = Button(top, text = "Select", command=self.openfile1).grid(row=1,column=4)
self.Butt2 = Button(top, text = "Select", command=self.openfile2).grid(row=2,column=4)
self.Butt3 = Button(top, text = "Select", command=self.openfile3).grid(row=3,column=4)
def openfile0(self):
tkf.askopenfile()
def openfile1(self):
tkf.askopenfile()
def openfile2(self):
tkf.askopenfile()
def openfile3(self):
tkf.askopenfile()
root = Tk()
app = App(root)
root.mainloop()
Comment