mς
­fIc           @   sE   d  Z  d k Td f  d     YZ e d j o d   Z e   n d S(   s'   A simple but flexible modal dialog box.(   t   *t   SimpleDialogc           B   sV   t  Z d g  d  d  d  d  d  Z d d d  Z d   Z d   Z d   Z d	   Z RS(
   Nt    c      	   C   s  | o t | d | |  _ n t |  |  _ | o$ |  i i |  |  i i |  n t |  i d | d d |  _	 |  i	 i
 d d d t  t |  i  |  _ |  i i
   | |  _ | |  _ | |  _ |  i i d |  i  x t t |   D]w }
 | |
 }	 t |  i d |	 d	 |  |
 d
  } |
 | j o | i d t d d  n | i
 d t d t d d  qτ W|  i i d |  i  |  i |  d  S(   Nt   class_t   textt   aspecti  t   expandi   t   fills   <Return>t   commandc         C   s   |  i |  S(   N(   t   selft   donet   num(   R	   R   (    (    t0   /mit/python/lib/python2.4/lib-tk/SimpleDialog.pyt   <lambda>   s    t   relieft   borderwidthi   t   sidet   WM_DELETE_WINDOW(   R   t   Toplevelt   masterR	   t   roott   titlet   iconnamet   MessageR   t   messaget   packt   BOTHt   Framet   framet   defaultR   t   cancelt   bindt   return_eventt   ranget   lent   buttonst   st   Buttont   bt   configt   RIDGEt   LEFTt   protocolt   wm_delete_windowt   _set_transient(   R	   R   R   R#   R   R   R   R   R&   R$   R   (    (    R   t   __init__	   s0    			 
 f0.5f0.29999999999999999c         C   sr  |  i } | i   | i |  | i   | i   o4 | i   } | i
   }
 | i   } | i   } n# | i   } | i   }
 d } } | i   } | i   } | | | | } | |
 | | }	 | | | i   j o | i   | } n | d j  o
 d } n |	 | | i   j o | i   | }	 n |	 d j  o
 d }	 n | i d | |	 f  | i   d  S(   Ni    s   +%d+%d(   R	   R   t   widgett   withdrawt	   transientR   t   update_idletaskst   winfo_ismappedt   winfo_widtht   m_widtht   winfo_heightt   m_heightt   winfo_rootxt   m_xt   winfo_rootyt   m_yt   winfo_screenwidtht   winfo_screenheightt   winfo_reqwidtht   w_widtht   winfo_reqheightt   w_heightt   relxt   xt   relyt   yt   geometryt	   deiconify(   R	   R   RA   RC   RB   R.   R:   R8   R>   RD   R6   R4   R@   (    (    R   R,   %   s4    	




c         C   s;   |  i i   |  i i   |  i i   |  i i   |  i S(   N(   R	   R   t   wait_visibilityt   grab_sett   mainloopt   destroyR   (   R	   (    (    R   t   goB   s
    c         C   s5   |  i d  j o |  i i   n |  i |  i  d  S(   N(   R	   R   t   NoneR   t   bellR
   (   R	   t   event(    (    R   R    I   s    c         C   s5   |  i d  j o |  i i   n |  i |  i  d  S(   N(   R	   R   RL   R   RM   R
   (   R	   (    (    R   R+   O   s    c         C   s   | |  _  |  i i   d  S(   N(   R   R	   R   t   quit(   R	   R   (    (    R   R
   U   s    	(	   t   __name__t
   __module__RL   R-   R,   RK   R    R+   R
   (    (    (    R   R      s   			t   __main__c          C   sj   t    } | d  } t | d d d | } | i   t | d d d | i }  |  i   | i   d  S(   Nc         C   sB   t  |  d d d d d d g d d d	 d
 d d } | i   GHd  S(   NR   s   This is a test dialog.  Would this have been an actual dialog, the buttons below would have been glowing in soft pink light.
Do you believe this?R#   t   Yest   Not   CancelR   i    R   i   R   s   Test Dialog(   R   R   t   dRK   (   R   RV   (    (    R   t   doit^   s    R   t   TestR   t   Quit(	   t   TkR   RW   R%   t   tR   RO   t   qRI   (   R\   RW   R   R[   (    (    R   t   test\   s    	

N(   t   __doc__t   TkinterR   RP   R]   (   R]   R   (    (    R   t   ?   s
   S	