Update utilities.py

This commit is contained in:
Saifeddine ALOUI 2024-03-04 10:58:09 +01:00 committed by GitHub
parent 9aa5c75e69
commit de39e5a86d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -59,23 +59,26 @@ def yes_or_no_input(prompt):
print("Please enter 'yes' or 'no'.")
def show_yes_no_dialog(title, text):
import tkinter as tk
from tkinter import messagebox
# Create a new Tkinter root window and hide it
root = tk.Tk()
root.withdraw()
# Make the window appear on top
root.attributes('-topmost', True)
try:
import tkinter as tk
from tkinter import messagebox
# Create a new Tkinter root window and hide it
root = tk.Tk()
root.withdraw()
# Show the dialog box
result = messagebox.askyesno(title, text)
# Destroy the root window
root.destroy()
return result
# Make the window appear on top
root.attributes('-topmost', True)
# Show the dialog box
result = messagebox.askyesno(title, text)
# Destroy the root window
root.destroy()
return result
except:
return yes_or_no_input(text)
def show_message_dialog(title, text):
import tkinter as tk
from tkinter import messagebox