popups in tkinter
from tkinter import messagebox
messagebox.showinfo(title="Error", message="No Data File Found.")
popups in tkinter
from tkinter import messagebox
messagebox.showinfo(title="Error", message="No Data File Found.")
make a pop up window in python
from tkinter import *
def alert_popup(title, message, path):
"""Generate a pop-up window for special messages."""
root = Tk()
root.title(title)
w = 400 # popup window width
h = 200 # popup window height
sw = root.winfo_screenwidth()
sh = root.winfo_screenheight()
x = (sw - w)/2
y = (sh - h)/2
root.geometry('%dx%d+%d+%d' % (w, h, x, y))
m = message
m += 'n'
m += path
w = Label(root, text=m, width=120, height=10)
w.pack()
b = Button(root, text="OK", command=root.destroy, width=10)
b.pack()
mainloop()
popup window python tkinter
import tkinter as tk
def popupmsg(msg, title):
root = tk.Tk()
root.title(title)
label = ttk.Label(root, text=msg)
label.pack(side="top", fill="x", pady=10)
B1 = tk.Button(root, text="Okay", command = root.destroy)
B1.pack()
popup.mainloop()
tkinter popup menu
#display menu on right click
def do_popup(self,event):
try:
self.popup_menu.tk_popup(event.x_root,
event.y_root)
finally:
self.popup_menu.grab_release()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us