def back(): root.destroy() from p2 import vp_start_gui vp_start_gui()
self.Canvas2 = tk.Canvas(self.Canvas1) self.Canvas2.place(relx=0.274, rely=0.04, relheight=0.644 , relwidth=0.468) self.Canvas2.configure(background="#ffffff") self.Canvas2.configure(highlightcolor="#ffffff") self.Canvas2.configure(highlightthickness="0") self.Canvas2.configure(insertbackground="black") self.Canvas2.configure(relief='ridge') self.Canvas2.configure(selectbackground="#ffffff") self.Canvas2.configure(selectforeground="black") self.Canvas2.configure(width=273) self.Canvas2.create_image(0, 0, image=self.image, anchor='nw', tags="IMG") self.Canvas2.bind("<Configure>", self.resize) top.after(2000, kill1) def resize(self, event): size = (event.width, event.height) resized = self.original.resize(size, Image.ANTIALIAS) self.image = ImageTk.PhotoImage(resized) self.Canvas2.delete("IMG") self.Canvas2.create_image(0, 0, image=self.image, anchor='nw', tags="IMG") if __name__ == '__main__': vp_start_gui()
def kill1(): root.destroy() from p2 import vp_start_gui vp_start_gui()
try: import Tkinter as tk except ImportError: import tkinter as tk try: import ttk py3 = False except ImportError: import tkinter.ttk as ttk py3 = True def init(top, gui, *args, **kwargs): global w, top_level, root w = gui top_level = top root = top def destroy_window(): # Function which closes the window. global top_level top_level.destroy() top_level = None if __name__ == '__main__': import p2 p2.vp_start_gui()