-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProgramm.py
66 lines (44 loc) · 1.52 KB
/
Programm.py
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
# __Author__ __Lencof__
# Programm.py
import pygame
from tkinter import *
from tkinter import filedialog
def mHello():
mText=ment.get()
mlabel1 = Label = Label(myApp,text=mText).pack()
def myNew():
mlabel1 = Label(myApp,text="YO").pack()
def myOpen():
myOpen = filedialog.askopenfile()
mlabe14 = Label(myApp,text=myOpen).pack()
def mAbout():
messagebox.showinfo(title="About",message="This is the about box")
def mQuit():
mExit = messagebox.askyesno(title="Quit", message="Are you sure")
if mExit > 0:
myApp.destroy()
myApp = tk()
ment = StringVar()
myApp.geometry('450x450+200+200')
myApp.title('MyApp')
mLabel = Label(myApp,text='my label').pack()
mButton = Button(myApp,text = 'OK', command = mHello).pack()
#set the ment variable from the text entry box
nEntry = Entry(myApp,textvariable=ment).pack()
# create the menubar
menubar = Menu(myApp)
# create the file component of the menubar
filemenu = Menu(menubar, tearoff=0)
# Add the sub headings to the file menu
filemenu.add_command(Label="New", command=myNew)
filemenu.add_command(Label="Open", command=myOpen)
filemenu.add_command(Label="Save As...")
filemenu.add_command(Label="Close", command=mQuit)
menubar.add_cascade(Label="File",menu=filemenu)
helpmenu = Menu(menubar, tearoff=0)
helpmenu.add_command(Label+"Help docs")
helpmenu.add_command(Label="About",command=mAbout)
menubar.add_cascade(Label="Help",menu=helpmenu)
# add menubarr to the window
myApp.config(menu=menubar)
myApp.mainloop() # close