How do I make a pop up in Tkinter when a button is clicked? How do I make a pop up in Tkinter when a button is clicked? tkinter tkinter

How do I make a pop up in Tkinter when a button is clicked?


If you want to display the text on a new window, then create a Toplevel widget and use it as the parent of the labels for the about text and the disclaimer.

By the way, Tkinter variables are not necessary if you have static text, so in this case you can simply get rid of them and replace them with multiline strings:

import sysfrom Tkinter import *ABOUT_TEXT = """AboutSPIES will search your chosen directory for photographs containingGPS information. SPIES will then plot the co-ordinates on Googlemaps so you can see where each photograph was taken."""DISCLAIMER = """DisclaimerSimon's Portable iPhone Exif-extraction Software (SPIES)software was made by Simon. This softwarecomes with no guarantee. Use at your own risk"""def clickAbout():    toplevel = Toplevel()    label1 = Label(toplevel, text=ABOUT_TEXT, height=0, width=100)    label1.pack()    label2 = Label(toplevel, text=DISCLAIMER, height=0, width=100)    label2.pack()app = Tk()app.title("SPIES")app.geometry("500x300+200+200")label = Label(app, text="Please browse to the directory you wish to scan", height=0, width=100)b = Button(app, text="Quit", width=20, command=app.destroy)button1 = Button(app, text="About SPIES", width=20, command=clickAbout)label.pack()b.pack(side='bottom',padx=0,pady=0)button1.pack(side='bottom',padx=5,pady=5)app.mainloop()