Wie mache ich ein pop-up in Tkinter, wenn ein button geklickt wird?

Wie mache ich ein pop-up in Tkinter, wenn ein button geklickt wird? Wenn die "Über" - button angeklickt wird, möchte ich ein pop-up mit dem Haftungsausschluss + über text.

Habe ich versucht, eine def-Methode, aber es muss sehr falsch, weil es nicht so funktioniert wie ich es gerne hätte. Jegliche Hilfe würde sehr geschätzt werden.

Danke

import sys
from Tkinter import *

def clickAbout(): 
    name = ("Thanks for the click")
    return

app = Tk()
app.title("SPIES")
app.geometry("500x300+200+200")

labelText = StringVar()
labelText.set ("Please browse to the directory you wish to scan")


labelText2 = StringVar()
labelText2.set ("About \n \n \
SPIES will search your chosen directory for photographs containing \n \
GPS information. SPIES will then plot the co-ordinates on Google \n \
maps so you can see where each photograph was taken.")

labelText3 = StringVar()
labelText3.set ("\n Disclaimer \n \n \
Simon's Portable iPhone Exif-extraction Software (SPIES) \n \
software was made by Simon. This software \n \
comes with no guarantee. Use at your own risk")

label1 = Label(app, textvariable=labelText, height=0, width=100)
label1.pack()

label1 = Label(app, textvariable=labelText2, height=0, width=100)
label1.pack()

label = Label(app, textvariable=labelText3, height=0, width=100)
label.pack()

b = Button(app, text="Quit", width=20, command=app.destroy)
b.pack(side='bottom',padx=0,pady=0)

button1 = Button(app, text="About SPIES", width=20, command=clickAbout)
button1.pack(side='bottom',padx=5,pady=5)

app.mainloop()
InformationsquelleAutor Bob Uni | 2013-06-23
Schreibe einen Kommentar