Advertisement
Guest User

lol

a guest
Apr 26th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.85 KB | None | 0 0
  1. import tkinter as ttk
  2.  
  3. class Noob(ttk.Tk):
  4.  
  5.     def __init__(self):
  6.        
  7.         super().__init__()
  8.  
  9.         self.geometry("1200x600")
  10.  
  11.         self.title("Lol")
  12.  
  13.         self.canvas = ttk.Canvas(self)
  14.  
  15.         self.kill = ttk.Button(self.canvas, text="You are a kid", width=30)
  16.  
  17.         self.image = ttk.PhotoImage(file="icons/hahahha.PNG")
  18.  
  19.         self.canvas.pack(fill="both", expand=1)
  20.  
  21.         self.kill.pack(side="top", expand=1)
  22.  
  23.         self.kill.bind("<Button-1>", self.kill1)
  24.  
  25.     def kill1(self, event=None):
  26.         self.canvas.create_text((700, 200), text="Who the fuck is this?", font="Times 40 bold", fill="black")
  27.         self.kill.destroy()
  28.         self.canvas.configure(bg="lightgrey")
  29.         self.canvas.create_image((700, 600), image=self.image)
  30.  
  31. if __name__ == "__main__":
  32.     main = Noob()
  33.     main.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement