我如何在python tkinter中同时打开和关闭某些东西?

时间:2017-11-21 20:12:55

标签: python tkinter

我有使用tkinter编码的代码。

def create_widgets(self):
    self.submit_button = Button(self, text ="Submit", command = self.popupmsg)
    self.submit_button.grid(row = 6, column = 0, sticky = W)



def popupmsg(self):
    popupmsg = Tk()
    popupmsg.wm_title("Test")
    self.grid()
    self.text = Text(popupmsg,text="test", width = 30, height = 10, wrap = WORD)
    self.text.grid(row = 8, column = 0, columnspan = 2, sticky = W)

我想知道是否有办法打开popupmsg并关闭create_widgets。我知道____。destroy()但是使用它我只能关闭它而不关闭它并打开一个新窗口

0 个答案:

没有答案