Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as tk
- from tkinter import *
- class okienko:
- def __init__(self, win):
- self.win = win
- self.win = Tk()
- self.win.title('Kolko i krzyzyk')
- self.geometry('300x400')
- def kolko_krzyzyk(self, zdarzenie):
- self.win.quit()
- self.win.destroy()
- interakcja0 = Button(win, text='O',
- font=('Courier', 25, 'bold'), background='blue')
- interakcja0.bind('<Button-1>', kolko_krzyzyk)
- interakcja0.grid(column=1, row=2)
- interakcja = Button(win, text='O',
- font=('Courier', 25, 'bold'), background='blue')
- interakcja.bind('<Button-1>', kolko_krzyzyk)
- interakcja.grid(column=2, row=2)
- interakcja2 = Button(win, text='O',
- font=('Courier', 25, 'bold'), background='blue')
- interakcja2.bind('<Button-1>', kolko_krzyzyk)
- # interakcja2.pack(fill=X)
- interakcja2.grid(column=3, row=2)
- interakcja3 = Button(win, text='O',
- font=('Courier', 25, 'bold'), background='blue')
- interakcja3.bind('<Button-1>', kolko_krzyzyk)
- interakcja3.grid(column=1, row=3)
- interakcja5 = Button(win, text='0',
- font=('Courier', 25, 'bold'), background='blue')
- interakcja5.bind('<Button-1>', kolko_krzyzyk)
- interakcja5.grid(column=2, row=3)
- interakcja6 = Button(win, text='0',
- font=('Courier', 25, 'bold'), background='blue')
- interakcja6.bind('<Button-1>', kolko_krzyzyk)
- interakcja6.grid(column=3, row=3)
- interakcja7 = Button(win, text='0',
- font=('Courier', 25, 'bold'), background='blue')
- interakcja7.bind('<Button-1>', kolko_krzyzyk)
- interakcja7.grid(column=1, row=4)
- interakcja8 = Button(win, text='0',
- font=('Courier', 25, 'bold'), background='blue')
- interakcja8.bind('<Button-1>', kolko_krzyzyk)
- interakcja8.grid(column=2, row=4)
- interakcja9 = Button(win, text='0',
- font=('Courier', 25, 'bold'), background='blue')
- interakcja9.bind('<Button-1>', kolko_krzyzyk)
- interakcja9.grid(column=3, row=4)
- win.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement