Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import as tk
- from tkinter import filedialog
- class SampleApp(tk.Tk):
- def __init__(self):
- tk.Tk.__init__(self)
- self.container = tk.Frame(self)
- self.container.pack(side="top", fill="both", expand=True)
- self._frame = PageFour(master=self.container, controller=self)
- def switch_frame(self, frame_class):
- new_frame = frame_class(master=self.container, controller=self)
- self._frame.destroy()
- self._frame = new_frame
- root = Tk()
- root.geometry('600x600')
- theLabel = Label(root, text='Deseja iniciar o Ciclo de Cura do Autoclave?')
- theLabel.pack()
- x1 = Button(root)
- photo = PhotoImage(file=u'C:\Users\Tiago\Desktop\Dudu\Pics\green1.gif')
- x1.config(image=photo, width='400', height='400', activebackground='black', bg='black', bd=0,
- command=lambda: controller.switch_frame(PageFive))
- x1.pack()
- x2 = Button(root)
- photo = PhotoImage(file=u'C:\Users\Tiago\Desktop\Dudu\Pics\red.gif')
- x2.config(image=photo, width='400', height='400', activebackground='black', bg='black', bd=0)
- x2.pack()
- class PageFive(tk.Frame):
- def __init__(self, master, controller):
- tk.Frame.__init__(self, master)
- self.controller = controller
- page_2_label = tk.Label(self, text="Página 5")
- page_2_label.pack(side="top", fill="x", pady=10)
- self.pack()
- if __name__ == "__main__":
- app = SampleApp()
- app.mainloop()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement