-
Notifications
You must be signed in to change notification settings - Fork 0
/
fram2
71 lines (50 loc) · 1.6 KB
/
fram2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 28 16:18:12 2016
@author: bmesy
"""
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 28 15:42:37 2016
@author: bmesy
"""
from tkinter import *
from PIL import Image, ImageTk
class Window (Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.master = master
self.init_window()
def init_window(self):
self.master.title("Cell's APP")
self.pack(fill =BOTH, expand=1)
menu = Menu(self.master)
self.master.config(menu = menu)
file = Menu(menu)
file.add_command(label ='Save')
file.add_command(label ='Exit', command=self.client_exit)
menu.add_cascade(label='File', menu=file)
edit = Menu(menu)
edit.add_command(label='Undo', command=self.undo)
menu.add_cascade(label='Edit', menu=edit)
edit=Menu(menu)
edit.add_command(label='Show Image', command = self.showImg)
edit.add_command(label='Show Text', command = self.showText)
menu.add_cascade(label='Edit', menu=edit)
def client_exit(self):
exit()
def undo(self):
exit()
def showImg(self):
load = Image.open('pic.jpg')
render=ImageTk.PhotoImage(load)
img = Label(self, image=render)
img.image = render
img.place(x=0,y=0)
def showText(self):
text = Label(self, text = 'Hey there good Lookin')
text.pack()
root = Tk()
root.geometry("400x300")
app =Window(root)
root.mainloop()