Skip to content
Snippets Groups Projects
Commit b0c756db authored by Leonardo Martinez Hornak's avatar Leonardo Martinez Hornak
Browse files

Demo tkinter app

parent 7e8f36da
Branches
Tags
No related merge requests found
......@@ -15,3 +15,6 @@
#Whitelist c files inside subdirectories
!**/*.c
!**/*.h
#Whitelist python files inside subdirectories
!**/*.py
\ No newline at end of file
import tkinter as tk
class Application(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.pack()
self.create_widgets()
def create_widgets(self):
self.hi_there = tk.Button(self)
self.hi_there["text"] = "Hello World\n(click me)"
self.hi_there["command"] = self.say_hi
self.hi_there.pack(side="top")
self.quit = tk.Button(self, text="QUIT", fg="red",
command=self.master.destroy)
self.quit.pack(side="bottom")
def say_hi(self):
print("hi there, everyone!")
root = tk.Tk()
app = Application(master=root)
app.mainloop()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment