mirror of
https://github.com/Xevion/tkinter-mini-projects.git
synced 2025-12-06 01:16:37 -06:00
init
This commit is contained in:
23
helloworld.py
Normal file
23
helloworld.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from tkinter import *
|
||||
|
||||
class App:
|
||||
def __init__(self, master):
|
||||
frame = Frame(master)
|
||||
frame.pack()
|
||||
|
||||
self.button = Button(
|
||||
frame, text="QUIT", fg="red", command=frame.quit
|
||||
)
|
||||
self.button.pack(side=LEFT)
|
||||
|
||||
self.hi_there = Button(frame, text="Hello", command=self.say_hi)
|
||||
self.hi_there.pack(side=LEFT)
|
||||
|
||||
def say_hi(self):
|
||||
print("Hello World!")
|
||||
|
||||
root = Tk()
|
||||
app = App(root)
|
||||
|
||||
root.mainloop()
|
||||
root.destroy()
|
||||
Reference in New Issue
Block a user