Answers for "tkinter popup"

1

popups in tkinter

from tkinter import messagebox
messagebox.showinfo(title="Error", message="No Data File Found.")
Posted by: Guest on February-06-2021
2

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()
Posted by: Guest on October-25-2020
-1

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()
Posted by: Guest on July-10-2020
0

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()
Posted by: Guest on March-27-2021

Python Answers by Framework

Browse Popular Code Answers by Language