ich habe einfach ein programm und würde gern wenn ein fehler auftritt
ein eigenes fenster öffnen lassen wo 2 buttons drin sind. Allerdings habe ich probleme das einfach rein zu packen ohne eine eigene klasse zu schreiben...denn das fenster soll sich auch selbst dann zerstören falls man auf abbruch drückt.
hier mal mein versuch
Code: Alles auswählen
def rueckgabe():
11 print "ok"
12 tk.destroy
13
14 #frame = Frame(root, bd = 1, relief = SUNKEN)
15 #frame.grid()
16
17 #Label(tk, text="jjjjgerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrjjjjjjjjjjjjjj").grid(row=0, column=0, columnspan = 2)
18 # Button(tk, text = "Abbruch", command = tk.destroy).grid(row = 1, column = 1, columnspan = 1, rowspan = 1, sticky = W+E+N+S)
19 # Button(tk, text = "Ok", command = rueckgabe).grid(row = 1, column = 0, sticky = W+E+N+S)
20
21 frame = Frame(tk, bd=3, relief=SUNKEN)
22
23 frame.pack(side=BOTTOM, fill = BOTH, expand=YES)
24 Label(tk, height=4,text='The defined output folder is already existent!\nDo you really want to overwrite' + \
25 ' the content within this folder?').pack(side=TOP, fill = BOTH, expand=YES)
26 Button(frame, text = "Ok", command = rueckgabe()).pack(side=LEFT, fill = BOTH, expand=YES)
27 Button(frame, text = "Abbruch", command = tk.destroy).pack(side=RIGHT, fill=BOTH,expand=YES)#row = 1, column = 1, sticky = EW)