MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / Application

Class Application

gui-apps/app_tkinter.py:4–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2
3
4class Application(tk.Frame):
5 def __init__(self, master=None):
6 super().__init__(master)
7 self.master = master
8 self.pack()
9 self.create_widgets()
10
11 def create_widgets(self):
12 self.hi_there = tk.Button(self)
13 self.hi_there["text"] = "Hello World\n(click me)"
14 self.hi_there["command"] = self.say_hi
15 self.hi_there.pack(side="top")
16
17 self.quit = tk.Button(self,
18 text="QUIT",
19 fg="red",
20 command=self.master.destroy)
21 self.quit.pack(side="bottom")
22
23 def say_hi(self):
24 print("hi there, everyone!")
25
26
27root = tk.Tk()

Callers 1

app_tkinter.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected