o
    bc                     @   sR  d dl mZ g dZdZdZdZdZdZdZd	Z	d
Z
dZdZdZdZdZdZdZdZdZG dd deZd6ddZd7ddZd7ddZd7ddZd7ddZd7d d!Zd7d"d#Zd7d$d%Zd7d&d'Zed(kreded)d* eded)d+ eded)d, eded)d- ed.ed)d/ ed0ed)d1 ed2ed)d3 ed4ed)d5 dS dS )8    )Dialog)showinfoshowwarning	showerroraskquestionaskokcancelaskyesnoaskyesnocancelaskretrycancelerrorinfoquestionwarningabortretryignoreokokcancelretrycancelyesnoyesnocancelabortretryignorecancelyesnoc                   @   s   e Zd ZdZdZdS )MessagezA message boxtk_messageBoxN)__name__
__module____qualname____doc__command r"   r"   )/usr/lib/python3.10/tkinter/messagebox.pyr   =   s    r   Nc                 K   sp   |r
d|vr
||d< |rd|vr||d< | r| |d< |r ||d< t di | }t|tr4|r2tS tS t|S )Nicontypetitlemessager"   )r   show
isinstanceboolYESNOstr)r&   r'   _icon_typeoptionsresr"   r"   r#   _showG   s   
r2   c                 K      t | |ttfi |S )zShow an info message)r2   INFOOKr&   r'   r0   r"   r"   r#   r   V      r   c                 K   r3   )zShow a warning message)r2   WARNINGr5   r6   r"   r"   r#   r   [   r7   r   c                 K   r3   )zShow an error message)r2   ERRORr5   r6   r"   r"   r#   r   `   r7   r   c                 K   r3   )zAsk a question)r2   QUESTIONYESNOr6   r"   r"   r#   r   e   r7   r   c                 K      t | |ttfi |}|tkS )z@Ask if operation should proceed; return true if the answer is ok)r2   r:   OKCANCELr5   r&   r'   r0   sr"   r"   r#   r   j      r   c                 K   r<   )z0Ask a question; return true if the answer is yes)r2   r:   r;   r+   r>   r"   r"   r#   r   p   r@   r   c                 K   s2   t | |ttfi |}t|}|tkrdS |tkS )zDAsk a question; return true if the answer is yes, None if cancelled.N)r2   r:   YESNOCANCELr-   CANCELr+   r>   r"   r"   r#   r	   v   s
   r	   c                 K   r<   )zDAsk if operation should be retried; return true if the answer is yes)r2   r8   RETRYCANCELRETRYr>   r"   r"   r#   r
      r@   r
   __main__SpamzEgg InformationzEgg Warningz	Egg Alertz	Question?proceedzProceed?zyes/nozGot it?zyes/no/cancelzWant it?z	try againz
Try again?)NNNN)NN)tkinter.commondialogr   __all__r9   r4   r:   r8   ABORTRETRYIGNOREr5   r=   rC   r;   rA   ABORTrD   IGNORErB   r+   r,   r   r2   r   r   r   r   r   r   r	   r
   r   printr"   r"   r"   r#   <module>   sN   










	