Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as ttk
- class Noob(ttk.Tk):
- def __init__(self):
- super().__init__()
- self.geometry("1200x600")
- self.title("Lol")
- self.canvas = ttk.Canvas(self)
- self.kill = ttk.Button(self.canvas, text="You are a kid", width=30)
- self.image = ttk.PhotoImage(file="icons/hahahha.PNG")
- self.canvas.pack(fill="both", expand=1)
- self.kill.pack(side="top", expand=1)
- self.kill.bind("<Button-1>", self.kill1)
- def kill1(self, event=None):
- self.canvas.create_text((700, 200), text="Who the fuck is this?", font="Times 40 bold", fill="black")
- self.kill.destroy()
- self.canvas.configure(bg="lightgrey")
- self.canvas.create_image((700, 600), image=self.image)
- if __name__ == "__main__":
- main = Noob()
- main.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement