Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
import tkinter as tk
|
||||
|
||||
class ClickCounter(tk.Frame):
|
||||
def __init__(self, master=None):
|
||||
super().__init__(master)
|
||||
tk.Pack.config(self)
|
||||
self.label = tk.Label(self, text='There have been no clicks yet')
|
||||
self.label.pack()
|
||||
self.button = tk.Button(self,
|
||||
text='click me',
|
||||
command=self.click)
|
||||
self.button.pack()
|
||||
self.count = 0
|
||||
|
||||
def click(self):
|
||||
self.count += 1
|
||||
self.label['text'] = f'Number of clicks: {self.count}'
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
ClickCounter().mainloop()
|
||||
Loading…
Add table
Add a link
Reference in a new issue