Advertisement
Guest User

Untitled

a guest
Feb 6th, 2020
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. import tkinter as tk
  2. from tkinter import *
  3.  
  4.  
  5. class okienko:
  6. def __init__(self, win):
  7. self.win = win
  8. self.win = Tk()
  9. self.win.title('Kolko i krzyzyk')
  10. self.geometry('300x400')
  11.  
  12. def kolko_krzyzyk(self, zdarzenie):
  13. self.win.quit()
  14. self.win.destroy()
  15.  
  16.  
  17. interakcja0 = Button(win, text='O',
  18.  
  19. font=('Courier', 25, 'bold'), background='blue')
  20. interakcja0.bind('<Button-1>', kolko_krzyzyk)
  21. interakcja0.grid(column=1, row=2)
  22.  
  23. interakcja = Button(win, text='O',
  24.  
  25. font=('Courier', 25, 'bold'), background='blue')
  26. interakcja.bind('<Button-1>', kolko_krzyzyk)
  27. interakcja.grid(column=2, row=2)
  28.  
  29. interakcja2 = Button(win, text='O',
  30.  
  31. font=('Courier', 25, 'bold'), background='blue')
  32. interakcja2.bind('<Button-1>', kolko_krzyzyk)
  33. # interakcja2.pack(fill=X)
  34. interakcja2.grid(column=3, row=2)
  35.  
  36. interakcja3 = Button(win, text='O',
  37.  
  38. font=('Courier', 25, 'bold'), background='blue')
  39. interakcja3.bind('<Button-1>', kolko_krzyzyk)
  40. interakcja3.grid(column=1, row=3)
  41.  
  42. interakcja5 = Button(win, text='0',
  43.  
  44. font=('Courier', 25, 'bold'), background='blue')
  45. interakcja5.bind('<Button-1>', kolko_krzyzyk)
  46. interakcja5.grid(column=2, row=3)
  47.  
  48. interakcja6 = Button(win, text='0',
  49.  
  50. font=('Courier', 25, 'bold'), background='blue')
  51. interakcja6.bind('<Button-1>', kolko_krzyzyk)
  52. interakcja6.grid(column=3, row=3)
  53.  
  54. interakcja7 = Button(win, text='0',
  55.  
  56. font=('Courier', 25, 'bold'), background='blue')
  57. interakcja7.bind('<Button-1>', kolko_krzyzyk)
  58. interakcja7.grid(column=1, row=4)
  59.  
  60. interakcja8 = Button(win, text='0',
  61.  
  62. font=('Courier', 25, 'bold'), background='blue')
  63. interakcja8.bind('<Button-1>', kolko_krzyzyk)
  64. interakcja8.grid(column=2, row=4)
  65.  
  66. interakcja9 = Button(win, text='0',
  67.  
  68. font=('Courier', 25, 'bold'), background='blue')
  69. interakcja9.bind('<Button-1>', kolko_krzyzyk)
  70. interakcja9.grid(column=3, row=4)
  71.  
  72. win.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement