There was an error while loading. Please reload this page.
1 parent 40d36bc commit 17db218Copy full SHA for 17db218
Button.py
@@ -0,0 +1,25 @@
1
+from tkinter import *
2
+
3
+class Window(Frame):
4
5
+ def __init__(self, master=None):
6
+ Frame.__init__(self, master)
7
+ self.master = master
8
9
+ # widget can take all window
10
+ self.pack(fill=BOTH, expand=1)
11
12
+ # create button, link it to clickExitButton()
13
+ exitButton = Button(self, text="Exit", command=self.clickExitButton)
14
15
+ # place button at (0,0)
16
+ exitButton.place(x=0, y=0)
17
18
+ def clickExitButton(self):
19
+ exit()
20
21
+root = Tk()
22
+app = Window(root)
23
+root.wm_title("Tkinter button")
24
+root.geometry("320x200")
25
+root.mainloop()
0 commit comments