1import tkinter as tk
2
3def popupmsg(msg, title):
4 root = tk.Tk()
5 root.title(title)
6 label = ttk.Label(root, text=msg)
7 label.pack(side="top", fill="x", pady=10)
8 B1 = tk.Button(root, text="Okay", command = root.destroy)
9 B1.pack()
10 popup.mainloop()
1 #display menu on right click
2 def do_popup(self,event):
3 try:
4 self.popup_menu.tk_popup(event.x_root,
5 event.y_root)
6 finally:
7 self.popup_menu.grab_release()