जब बटन क्लिक किया जाता है तो मैं टिंकर में पॉप-अप कैसे बना सकता हूं? जब 'के बारे में' बटन क्लिक किया जाता है, तो मैं अस्वीकरण के साथ पॉप अप चाहता हूं + पाठ के बारे में।जब बटन क्लिक किया जाता है तो मैं टिंकर में पॉप अप कैसे करूं?
मैंने एक डीफ़ विधि स्थापित करने का प्रयास किया है लेकिन यह बहुत गलत होना चाहिए क्योंकि यह काम नहीं कर रहा है। किसी भी मदद को बहुत, बहुत सराहा जाएगा। आप, एक नई विंडो पर पाठ प्रदर्शित तो एक उच्चस्तरीय विजेट बना सकते हैं और के बारे में पाठ और त्याग के लिए लेबल की मूल रूप में इसका इस्तेमाल करना चाहते हैं
आप
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()
धन्यवाद, कि एक महान था मदद –
@ बॉब: नई विंडो को सक्रिय करने के लिए आप 'क्लिकऑबआउट()' फ़ंक्शन के अंत में 'toplevel.focus_force() 'जोड़ना चाह सकते हैं (इस तरह अधिकांश चीजों में इस तरह की चीजें कैसे काम करती हैं)। – martineau