I am here again.I am sure you can help me.I need any function like destroy which can delete window.The programm you can see on <a href="http://poradna.programujte.com/viewtopic.php?t=973" target="_top" rel="nofollow">http://poradna.programujte.com/viewtopic.php?t=973</a>
<br>If you run in, You will see a menu.If you open &quot;rozrh hodin&quot; and then you open &quot;prumer&quot; you will see 3 windows.How to delete 2 old windows?I would like see all timees only one window:
<br>Here is the programm:
<br>
<br>
<br>from Tkinter import *
<br>import sys
<br>
<br>okno=Tk()
<br>
<br>
<br>
<br>
<br>
<br>
<br>zaznam=0.000
<br>man=0.000
<br>
<br>def znic():
<br>&nbsp; &nbsp; okno.destroy
<br>&nbsp; &nbsp;
<br>def prumery():
<br>&nbsp; &nbsp; top=Toplevel()
<br>&nbsp; &nbsp; okno.destroy
<br>&nbsp; &nbsp; def dement1():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global zaznam,man,dement1
<br>&nbsp; &nbsp; &nbsp; &nbsp; zaznam=zaznam+1.000
<br>&nbsp; &nbsp; &nbsp; &nbsp; man=man+1.000
<br>&nbsp; &nbsp; def dement2():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global zaznam,man,dement2
<br>&nbsp; &nbsp; &nbsp; &nbsp; zaznam=zaznam+2.000
<br>&nbsp; &nbsp; &nbsp; &nbsp; man=man+1.00
<br>&nbsp; &nbsp; def dement3():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global zaznam,man,dement3
<br>&nbsp; &nbsp; &nbsp; &nbsp; zaznam=zaznam+3.000
<br>&nbsp; &nbsp; &nbsp; &nbsp; man=man+1.000
<br>&nbsp; &nbsp; def dement4():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global zaznam,man,dement4
<br>&nbsp; &nbsp; &nbsp; &nbsp; zaznam=zaznam+4.000
<br>&nbsp; &nbsp; &nbsp; &nbsp; man=man+1.000
<br>&nbsp; &nbsp; def dement5():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global zaznam,man,dement5
<br>&nbsp; &nbsp; &nbsp; &nbsp; zaznam=zaznam+5.000
<br>&nbsp; &nbsp; &nbsp; &nbsp; man=man+1.000
<br>&nbsp; &nbsp; def money():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global zaznam,man,money
<br>&nbsp; &nbsp; &nbsp; &nbsp; prumer1.configure(text=zaznam/man)
<br>&nbsp; &nbsp;
<br>&nbsp; &nbsp; prvni=Button(top, text=&quot;1&quot;,command=dement1)
<br>&nbsp; &nbsp; prvni.grid(row=1, column=0)
<br>
<br>&nbsp; &nbsp; druhy=Button(top, text=&quot;2&quot;,command=dement2)
<br>&nbsp; &nbsp; druhy.grid(row=2, column=0)
<br>
<br>&nbsp; &nbsp; treti=Button(top, text=&quot;3&quot;,command=dement3)
<br>&nbsp; &nbsp; treti.grid(row=3,column=0)
<br>
<br>&nbsp; &nbsp; ctvrty=Button(top, text=&quot;4&quot;,command=dement4)
<br>&nbsp; &nbsp; ctvrty.grid(row=4,column=0)
<br>
<br>&nbsp; &nbsp; paty=Button(top, text=&quot;5&quot;,command=dement5)
<br>&nbsp; &nbsp; paty.grid(row=5,column=0)
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<br>&nbsp; &nbsp; prumer=Button(top, text=&quot;Prumer&quot;,command=money)
<br>&nbsp; &nbsp; prumer.grid(row=1, column=2)
<br>
<br>&nbsp; &nbsp; prumer1=Label(top, text=&quot;Prumer:&quot;)
<br>&nbsp; &nbsp; prumer1.grid(row=4, column=2)
<br>&nbsp; &nbsp;
<br>&nbsp; &nbsp;
<br>
<br>&nbsp; &nbsp; menubar = Menu(top)
<br>
<br>&nbsp; &nbsp; # create a pulldown menu, and add it to the menu bar
<br>&nbsp; &nbsp; filemenu = Menu(menubar, tearoff=0)
<br>&nbsp; &nbsp; filemenu.add_command(label=&quot;Rozvrh&quot;, command=(veci))
<br>&nbsp; &nbsp; filemenu.add_separator()
<br>&nbsp; &nbsp; menubar.add_cascade(label=&quot;Rozvrh hodin&quot;, menu=filemenu)
<br>
<br>&nbsp; &nbsp; # create more pulldown menus
<br>&nbsp; &nbsp; editmenu = Menu(menubar, tearoff=0)
<br>&nbsp; &nbsp; editmenu.add_command(label=&quot;Prumer&quot;, command=prumery)
<br>&nbsp; &nbsp; menubar.add_cascade(label=&quot;Prumer&quot;, menu=editmenu)
<br>
<br>
<br>
<br>&nbsp; &nbsp; helpmenu = Menu(menubar, tearoff=0)
<br>&nbsp; &nbsp; helpmenu.add_command(label=&quot;Exit&quot;, command=okno.destroy)
<br>&nbsp; &nbsp; helpmenu.add_command(label=&quot;save&quot;, command=Save)
<br>&nbsp; &nbsp; menubar.add_cascade(label=&quot;Exit&quot;, menu=helpmenu)
<br>
<br>
<br>
<br>&nbsp; &nbsp; top.config(menu=menubar)
<br>def veci():
<br>&nbsp; &nbsp; okno.destroy
<br>&nbsp; &nbsp; top=Toplevel()
<br>&nbsp; &nbsp; def TV1():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global tv1,TV1
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Telesna vychova;Peter Kuba;Mala telocvicna&quot;)
<br>&nbsp; &nbsp; def M1():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global m1,M1
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Matematika,Hana Rosolova;Ucebna c.37&quot;)
<br>&nbsp; &nbsp; def F1():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global f1, F1
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Fyzika, Hana Rosolova;Ucebna c.42&quot;)
<br>&nbsp; &nbsp; def C1():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global c1, C1
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Cesky jazyk-Literatura;Lenka Necasova;Ucebna c.16&quot;)
<br>&nbsp; &nbsp; def D1():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global d1,D1
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Dejepis;Jan Kvirenc;Ucebna c.35&quot;)
<br>&nbsp; &nbsp; def prm():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global zaznam
<br>&nbsp; &nbsp; &nbsp; &nbsp; zaznam=0.000
<br>&nbsp; &nbsp; &nbsp; &nbsp; man=0.000
<br>&nbsp; &nbsp; def A1():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global a1
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Anglicky jazyk;Adam Kosik;Ucebna c.41&quot;)
<br>&nbsp; &nbsp; def V():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global v1,v2
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Vytvarna Vychova;Cech Matej;Ucebna c.53&quot;)
<br>&nbsp; &nbsp; def N1():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global n1
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Nemecky jazyk;Pacholikova Marie;Ucebna c.42&quot;)
<br>&nbsp; &nbsp; def M2():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global m2
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Matematika;Hana Rosolova;Ucebna c.45&quot;)
<br>&nbsp; &nbsp; def CH1():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global c1
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Chemie;Buth Stanislav;Ucebna c.24&quot;)
<br>&nbsp; &nbsp; def Z1():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global z1
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Zemepis;Jitka Breitschneiderova;Ucebna c.14&quot;)
<br>&nbsp; &nbsp; def C2():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global c2
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Cesky jazyk;Lenka Necasova;Ucebna c.04&quot;)
<br>&nbsp; &nbsp; def B1():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global b1
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Biologie;Jarmila Ekschlagerova;Ucebna c.32&quot;)
<br>&nbsp; &nbsp; def OV1():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global ov1
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Obcanska vychova;Kadlec Frantisek;Ucebna c.11&quot;)
<br>&nbsp; &nbsp; def N2():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global n2
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Nemecky jazyk;Pacholikova Marie;Ucebna c.42&quot;)
<br>&nbsp; &nbsp; def D2():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global d2
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Dejepis;Jan Kvirenc;Ucebna c.23&quot;)
<br>&nbsp; &nbsp; def M3():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global m3
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Matematika;Hana Rosolova;Ucebna c.26&quot;)
<br>&nbsp; &nbsp; def TV2():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global tv2
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Telesna vychova;Kuba Peter;Posilovna&quot;)
<br>&nbsp; &nbsp; def F2():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global f2
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Fyzika;Hana Rosolova;Ucebna c.42&quot;)
<br>&nbsp; &nbsp; def C3():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global c3
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Cesky jazyk;Lenka Necasova;Ucebna c.04&quot;)
<br>&nbsp; &nbsp; def Z2():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global z2
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Zemepis;Jitka Breitschneiderova;Ucebna c.13&quot;)
<br>&nbsp; &nbsp; def B2():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global b2
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Biologie;Jarmila Ekschlagerova;Ucebna c.34&quot;)
<br>&nbsp; &nbsp; def A2():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global a2
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Anglicky jazyk;Adam Kosik;Ucebna c.53&quot;)
<br>&nbsp; &nbsp; def I():
<br>&nbsp; &nbsp; &nbsp; &nbsp; i1,i2
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Informatika;*** Drbohlavova;Ucebna c.02&quot;)
<br>&nbsp; &nbsp; def A3():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global a3
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Anglicky jazyk;Adam Kosik;Ucebna c.46&quot;)
<br>&nbsp; &nbsp; def N3():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global n3
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Nemecky jazyk;Pacholikova Marie;Ucebna c.36&quot;)
<br>&nbsp; &nbsp; def H():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global h
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Hudebni vychova;Duskova Marie;Ucebna c.54&quot;)
<br>&nbsp; &nbsp; def CH2():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global ch2
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Chemie;Buth Stanislav;Ucebna c.26&quot;)
<br>&nbsp; &nbsp; def M4():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global m4
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Matematika;Hana Rosolova;Ucebna c.41&quot;)
<br>&nbsp; &nbsp; def C4():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global c4
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Cesky jazyk;Lenka Necasova;Ucebna c.12&quot;)
<br>&nbsp; &nbsp; def TV3():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global tv3
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Telesna vychova;Kuba Peter;Velka telocvicna&quot;)
<br>&nbsp; &nbsp; def obed():
<br>&nbsp; &nbsp; &nbsp; &nbsp; global o1
<br>&nbsp; &nbsp; &nbsp; &nbsp; free1.configure(text=&quot;Pausa na obed.&quot;)
<br>
<br>
<br>&nbsp; &nbsp; pondeli=Label(top, text=&quot;Pondeli&quot;, background='white', foreground='red',activeforeground='yellow')
<br>&nbsp; &nbsp; pondeli.grid(row=1, column=4) &nbsp; &nbsp; &nbsp; &nbsp; 
<br>
<br>&nbsp; &nbsp; utery=Label(top, text=&quot;Utery&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; utery.grid(row=2, column=4)
<br>
<br>&nbsp; &nbsp; streda=Label(top, text=&quot;Streda&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; streda.grid(row=3, column=4)
<br>
<br>&nbsp; &nbsp; ctvrtek=Label(top, text=&quot;Ctvrtek&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; ctvrtek.grid(row=4, column=4)
<br>
<br>&nbsp; &nbsp; patek=Label(top, text=&quot;Patek&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; patek.grid(row=5, column=4)
<br>
<br>
<br>&nbsp; &nbsp; hod1=Label(top, text=&quot;1.Hodina&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; hod1.grid(row=0, column=5)
<br>
<br>&nbsp; &nbsp; hod2=Label(top , text=&quot;2.Hodina&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; hod2.grid(row=0, column=6)
<br>
<br>&nbsp; &nbsp; hod3=Label(top, text=&quot;3.Hodina&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; hod3.grid(row=0, column=7)
<br>
<br>&nbsp; &nbsp; hod4=Label(top, text=&quot;4.Hodina&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; hod4.grid(row=0, column=8)
<br>
<br>&nbsp; &nbsp; hod5=Label(top, text=&quot;5.Hodina&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; hod5.grid(row=0, column=9)
<br>
<br>&nbsp; &nbsp; hod6=Label(top, text=&quot;6.Hodina&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; hod6.grid(row=0,column=10)
<br>
<br>&nbsp; &nbsp; hod7=Label(top, text=&quot;7.Hodina&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; hod7.grid(row=0, column=11)
<br>
<br>&nbsp; &nbsp; hod8=Label(top, text=&quot;8.Hodina&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; hod8.grid(row=0, column=12)
<br>
<br>&nbsp; &nbsp; hod9=Label(top, text=&quot;9.Hodina&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; hod9.grid(row=0,column=13)
<br>
<br>&nbsp; &nbsp; hod10=Label(top, text=&quot;10.Hodina&quot;, background='white', foreground='red')
<br>&nbsp; &nbsp; hod10.grid(row=0, column=14)
<br>
<br>&nbsp; &nbsp; tv1=Button(top, text=&quot;Tv&quot;, command=TV1, background='pink',activebackground='yellow')
<br>&nbsp; &nbsp; tv1.grid(row=1, column=5)
<br>
<br>&nbsp; &nbsp; m1=Button(top, text=&quot;M&quot;, command=M1, background='red')
<br>&nbsp; &nbsp; m1.grid(row=1,column=6)
<br>
<br>&nbsp; &nbsp; f1=Button(top, text=&quot;F&quot;, command=F1, background='brown')
<br>&nbsp; &nbsp; f1.grid(row=1, column=7)
<br>
<br>&nbsp; &nbsp; c1=Button(top, text=&quot;Cj&quot;, command=C1, background='blue')
<br>&nbsp; &nbsp; c1.grid(row=1, column=8)
<br>
<br>&nbsp; &nbsp; d1=Button(top, text=&quot;D&quot; , command=D1, background='Black', foreground='white')
<br>&nbsp; &nbsp; d1.grid(row=1, column=9) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
<br>&nbsp; &nbsp; a1=Button(top, text=&quot;Aj&quot;, command=A1, background='green')
<br>&nbsp; &nbsp; a1.grid(row=1, column=10)
<br>
<br>&nbsp; &nbsp; v1=Button(top, text=&quot;Vv&quot;, command=V, foreground='blue')
<br>&nbsp; &nbsp; v1.grid(row=1, column=12)
<br>
<br>&nbsp; &nbsp; v2=Button(top, text=&quot;Vv&quot;, command=V, foreground='blue')
<br>&nbsp; &nbsp; v2.grid(row=1, column=13)
<br>
<br>&nbsp; &nbsp; n1=Button(top, text=&quot;Nj&quot;, command=N1, background='yellow')
<br>&nbsp; &nbsp; n1.grid(row=2, column=5)
<br>
<br>&nbsp; &nbsp; m2=Button(top, text=&quot;M&quot;, command=M2, background='red')
<br>&nbsp; &nbsp; m2.grid(row=2, column=6)
<br>
<br>&nbsp; &nbsp; ch1=Button(top, text=&quot;Ch&quot;, command=CH1, background='orange')
<br>&nbsp; &nbsp; ch1.grid(row=2, column=7)
<br>
<br>&nbsp; &nbsp; z1=Button(top, text=&quot;Z&quot;, command=Z1, background='grey')
<br>&nbsp; &nbsp; z1.grid(row=2, column=8)
<br>
<br>&nbsp; &nbsp; c2=Button(top, text=&quot;Cj&quot;, command=C2, background='blue')
<br>&nbsp; &nbsp; c2.grid(row=2, column=9)
<br>
<br>&nbsp; &nbsp; b1=Button(top, text=&quot;B&quot;, command=B1, foreground='red')
<br>&nbsp; &nbsp; b1.grid(row=2, column=10)
<br>
<br>&nbsp; &nbsp; ov1=Button(top, text=&quot;Ov&quot;, command=OV1, foreground='green')
<br>&nbsp; &nbsp; ov1.grid(row=3, column=5)
<br>
<br>&nbsp; &nbsp; n2=Button(top, text=&quot;Nj&quot;, command=N2, background='yellow')
<br>&nbsp; &nbsp; n2.grid(row=3, column=6)
<br>
<br>&nbsp; &nbsp; d2=Button(top, text=&quot;D&quot;, command=D2, background='Black', foreground='white')
<br>&nbsp; &nbsp; d2.grid(row=3, column=7)
<br>
<br>&nbsp; &nbsp; m3=Button(top, text=&quot;M&quot;, command=M3, background='red')
<br>&nbsp; &nbsp; m3.grid(row=3, column=8)
<br>
<br>&nbsp; &nbsp; tv2=Button(top, text=&quot;Tv&quot;, command=TV2, background='pink')
<br>&nbsp; &nbsp; tv2.grid(row=3,column=10)
<br>
<br>&nbsp; &nbsp; f2=Button(top, text=&quot;F&quot;, command=F2, background='brown')
<br>&nbsp; &nbsp; f2.grid(row=3, column=11)
<br>
<br>&nbsp; &nbsp; c3=Button(top, text=&quot;Cj&quot;, command=C3, background='blue')
<br>&nbsp; &nbsp; c3.grid(row=4, column=7)
<br>
<br>&nbsp; &nbsp; z2=Button(top, text=&quot;Z&quot;, command=Z2, background='grey')
<br>&nbsp; &nbsp; z2.grid(row=4, column=8)
<br>
<br>&nbsp; &nbsp; b2=Button(top, text=&quot;B&quot;, command=B2, foreground='red')
<br>&nbsp; &nbsp; b2.grid(row=4, column=9)
<br>
<br>&nbsp; &nbsp; a2=Button(top, text=&quot;Aj&quot;, command=A2, background='green')
<br>&nbsp; &nbsp; a2.grid(row=4, column=11)
<br>
<br>&nbsp; &nbsp; i1=Button(top, text=&quot;In&quot;, command=I, foreground='orange')
<br>&nbsp; &nbsp; i1.grid(row=4, column=12)
<br>
<br>&nbsp; &nbsp; i2=Button(top, text=&quot;In&quot;, command=I, foreground='orange')
<br>&nbsp; &nbsp; i2.grid(row=4,column=13)
<br>
<br>&nbsp; &nbsp; a3=Button(top, text=&quot;Aj&quot;, command=A3, background='green')
<br>&nbsp; &nbsp; a3.grid(row=5,column=5)
<br>
<br>&nbsp; &nbsp; n3=Button(top, text=&quot;Nj&quot;, command=N3, background='yellow')
<br>&nbsp; &nbsp; n3.grid(row=5,column=6)
<br>
<br>&nbsp; &nbsp; h=Button(top, text=&quot;Hv&quot;, command=H, foreground='yellow')
<br>&nbsp; &nbsp; h.grid(row=5, column=7)
<br>
<br>&nbsp; &nbsp; ch2=Button(top, text=&quot;Ch&quot;, command=CH2, background='orange')
<br>&nbsp; &nbsp; ch2.grid(row=5, column=8)
<br>
<br>&nbsp; &nbsp; m4=Button(top, text=&quot;M&quot;, command=M4, background='red')
<br>&nbsp; &nbsp; m4.grid(row=5, column=9)
<br>
<br>&nbsp; &nbsp; c4=Button(top, text=&quot;Cj&quot;, command=C3, background='blue')
<br>&nbsp; &nbsp; c4.grid(row=5, column=10)
<br>
<br>&nbsp; &nbsp; tv3=Button(top, text=&quot;Tv&quot;, command=TV3, background='pink')
<br>&nbsp; &nbsp; tv3.grid(row=5, column=12)
<br>&nbsp; &nbsp;
<br>
<br>&nbsp; &nbsp; &nbsp;
<br>&nbsp; &nbsp; &nbsp; &nbsp;
<br>&nbsp; &nbsp; def hello():
<br>&nbsp; &nbsp; &nbsp; &nbsp; print &quot;hello!&quot;
<br>
<br>&nbsp; &nbsp; menubar = Menu(top)
<br>
<br>&nbsp; &nbsp; # create a pulldown menu, and add it to the menu bar
<br>&nbsp; &nbsp; filemenu = Menu(menubar, tearoff=0)
<br>&nbsp; &nbsp; filemenu.add_command(label=&quot;Rozvrh&quot;, command=veci)
<br>&nbsp; &nbsp; filemenu.add_separator()
<br>&nbsp; &nbsp; menubar.add_cascade(label=&quot;Rozvrh hodin&quot;, menu=filemenu)
<br>
<br>&nbsp; &nbsp; # create more pulldown menus
<br>&nbsp; &nbsp; editmenu = Menu(menubar, tearoff=0)
<br>&nbsp; &nbsp; editmenu.add_command(label=&quot;Prumer&quot;, command=prumery)
<br>&nbsp; &nbsp; menubar.add_cascade(label=&quot;Prumer&quot;, menu=editmenu)
<br>
<br>
<br>
<br>&nbsp; &nbsp; helpmenu = Menu(menubar, tearoff=0)
<br>&nbsp; &nbsp; helpmenu.add_command(label=&quot;Exit&quot;, command=okno.destroy)
<br>&nbsp; &nbsp; helpmenu.add_command(label=&quot;save&quot;, command=Save)
<br>&nbsp; &nbsp; menubar.add_cascade(label=&quot;Exit&quot;, menu=helpmenu)
<br>
<br>
<br>
<br>&nbsp; &nbsp; top.config(menu=menubar)
<br>
<br>
<br>&nbsp;
<br>&nbsp; &nbsp;
<br>
<br>&nbsp; &nbsp; #fereeesdfdsfdsf
<br>&nbsp; &nbsp; free=Label(top, text=&quot;Podrobnosti:&quot;)
<br>&nbsp; &nbsp; free.grid(row=1, column=16)
<br>
<br>&nbsp; &nbsp; free1=Label(top, text=&quot;&quot;)
<br>&nbsp; &nbsp; free1.grid(row=2, column=16)
<br>
<br>
<br>
<br>
<br>def Save(self):
<br>&nbsp; &nbsp; &quot;Ulozeni dokumentu&quot;
<br>&nbsp; &nbsp; soubor = file(self.filename,'w')
<br>&nbsp; &nbsp; soubor.write(self.text.get(&quot;1.0&quot;,END).encode(KODOVANI))
<br>&nbsp; &nbsp; soubor.close()
<br>
<br>&nbsp; &nbsp; &nbsp;
<br>&nbsp; &nbsp;
<br>def hello():
<br>&nbsp; &nbsp; print &quot;hello!&quot;
<br>
<br>menubar = Menu(okno)
<br>
<br># create a pulldown menu, and add it to the menu bar
<br>filemenu = Menu(menubar, tearoff=0)
<br>filemenu.add_command(label=&quot;Rozvrh&quot;, command=(veci))
<br>filemenu.add_separator()
<br>menubar.add_cascade(label=&quot;Rozvrh hodin&quot;, menu=filemenu)
<br>
<br># create more pulldown menus
<br>editmenu = Menu(menubar, tearoff=0)
<br>editmenu.add_command(label=&quot;Prumer&quot;, command=prumery)
<br>menubar.add_cascade(label=&quot;Prumer&quot;, menu=editmenu)
<br>
<br>
<br>
<br>helpmenu = Menu(menubar, tearoff=0)
<br>helpmenu.add_command(label=&quot;Exit&quot;, command=okno.destroy)
<br>helpmenu.add_command(label=&quot;save&quot;, command=Save)
<br>menubar.add_cascade(label=&quot;Exit&quot;, menu=helpmenu)
<br>
<br>
<br>
<br>okno.config(menu=menubar)
<br>
<br>
<br>
<br>
<br>mainloop()
<br><hr align="left" width="300">
View this message in context: <a href="http://www.nabble.com/I-am-aking-again-t1033125.html#a2680779">I am aking again</a><br>
Sent from the <a href="http://www.nabble.com/Python---tkinter-discuss-f2980.html">Python - tkinter-discuss</a> forum at Nabble.com.