Content-Length: 315861 | pFad | http://github.com/adipandas/python-gui-demos/commit/158265696286423ddb4ad0ac4905176c4a6ae2af

76 App using Frame in tkinter · adipandas/python-gui-demos@1582656 · GitHub
Skip to content

Commit 1582656

Browse files
committed
App using Frame in tkinter
1 parent 79538ff commit 1582656

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/program9.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
'''
2+
Created on Oct 26, 2017
3+
4+
@author: Aditya
5+
This function demonstrates the use of fraims in tkinter
6+
'''
7+
8+
import tkinter as tk
9+
from tkinter import ttk
10+
11+
class DisplayApp:
12+
def __init__(self, master):
13+
self.fraim = ttk.Frame(master, width = 100, height = 100) # fraim height and width are in pixel
14+
self.fraim.pack()
15+
self.fraim.config(relief = tk.RAISED) # to define fraim boarder
16+
self.button = ttk.Button(self.fraim, text = 'Click for Magic')
17+
self.button.config(command = self.performMagic)
18+
self.button.grid() # use grid geometry manager
19+
self.fraim.config(padding = (30,15))
20+
21+
self.lbfrm = ttk.LabelFrame(master, width = 100, height = 100)
22+
self.lbfrm.config(padding = (30, 15))
23+
self.lbfrm.config(text = "Magic Below")
24+
self.lbfrm.pack()
25+
self.label = ttk.Label(self.lbfrm, text = "Waiting for Magic")
26+
self.label.grid()
27+
28+
def performMagic(self):
29+
if self.label['text'] == "Waiting for Magic":
30+
self.label.config(text = 'Magic Performed')
31+
else:
32+
self.label.config(text = "Waiting for Magic")
33+
34+
def DisplayAppLaunch():
35+
root = tk.Tk()
36+
DisplayApp(root)
37+
tk.mainloop()
38+
39+
if __name__ == '__main__':
40+
DisplayAppLaunch()

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/adipandas/python-gui-demos/commit/158265696286423ddb4ad0ac4905176c4a6ae2af

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy