Advertisement
Osiris1002

tkinter

Feb 18th, 2024
779
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. import tkinter as tk
  2.  
  3. def refresh_window():
  4.     # Redraw the window
  5.     window.update()
  6.     window.update_idletasks()
  7.     print("Refresh completed.")
  8.  
  9. # Create the main window
  10. window = tk.Tk()
  11. window.geometry("300x300")
  12. window.title("PythonExamples.org")
  13.  
  14. label = tk.Label(window, text="Click the below button to refresh the window.")
  15. label.pack()
  16.  
  17. button = tk.Button(window, text="Refresh", command=refresh_window)
  18. button.pack()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement