;
ะโ"Ic               @   s   d  Z  d d l Td d l j Z Gd   d e  Z e d k o< e   Z	 d   Z
 e e	 d d	 d
 e
 j   e	 j   n d S(   u~   
Dialog that allows user to specify a new config file section name.
Used to get new highlight theme and keybinding set names.
i    (   u   *Nc             B   sA   |  Ee  Z d    Z d   Z d   Z d d  Z d d  Z d S(   c             C   s>  t  j |  |  |  j d d  |  j d t d t  |  j |  |  j |  |  j   |  j d |  j	  | |  _
 | |  _ | |  _ d |  _ |  j   |  j   |  j   |  j j d |  j j    |  j d | j   | j   d |  j   d | j   | j   d |  j   d f  |  j   |  j   d	 S(
   u   
        message - string, informational message to display
        usedNames - list, list of names already in use for validity check
        u   borderwidthi   u   heightu   widthu   WM_DELETE_WINDOWu    u   +%d+%di   N(   u   Toplevelu   __init__u	   configureu	   resizableu   FALSEu   titleu	   transientu   grab_setu   protocolu   Cancelu   parentu   messageu	   usedNamesu   resultu   CreateWidgetsu   withdrawu   update_idletasksu   messageInfou   configu	   frameMainu   winfo_reqwidthu   geometryu   winfo_rootxu   winfo_widthu   winfo_rootyu   winfo_heightu   winfo_reqheightu	   deiconifyu   wait_window(   u   selfu   parentu   titleu   messageu	   usedNames(    (    u<   /mit/python/lib/python3.0/idlelib/configSectionNameDialog.pyu   __init__	   s,    
				


	
c             C   s  t  |   |  _ t  |   |  _ t |  d d d t |  _ |  j j d t d t d t	  t
 |  j d t d t d	 d
 d d
 d |  j |  _ t |  j d |  j d d } | j   |  j j d	 d
 d d
  | j d	 d
 d d
  t |   } | j d t d t  t | d d d d d |  j |  _ |  j j d d d d d	 d
 d d
  t | d d d d d |  j |  _ |  j j d d d d d	 d
 d d
  d  S(   Nu   borderwidthi   u   reliefu   sideu   expandu   fillu   anchoru   justifyu   padxi   u   padyu   textu   textvariableu   widthi   u   Oki   u   commandu   rowi    u   columnu   Canceli   (   u	   StringVaru   nameu   fontSizeu   Frameu   SUNKENu	   frameMainu   packu   TOPu   TRUEu   BOTHu   Messageu   Wu   LEFTu   messageu   messageInfou   Entryu	   focus_setu   BOTTOMu   Xu   Buttonu   Oku   buttonOku   gridu   Cancelu   buttonCancel(   u   selfu	   entryNameu   frameButtons(    (    u<   /mit/python/lib/python3.0/idlelib/configSectionNameDialog.pyu   CreateWidgets&   s$    $
%c             C   sร   d } |  j  j   } | j   | p& t j d d d d d |   d } nt t |  d k o* t j d d d d	 d
 d |   d } n7 | |  j k o& t j d d d d d |   d } n | S(   Ni   u   titleu
   Name Erroru   messageu   No name specified.u   parenti    i   u)   Name too long. It should be no more than u   30 characters.u   This name is already in use.(   u   nameu   getu   stripu   tkMessageBoxu	   showerroru   lenu	   usedNames(   u   selfu   nameOku   name(    (    u<   /mit/python/lib/python3.0/idlelib/configSectionNameDialog.pyu   NameOk:   s"    



c             C   s7   |  j    o& |  j j   j   |  _ |  j   n d  S(   N(   u   NameOku   nameu   getu   stripu   resultu   destroy(   u   selfu   event(    (    u<   /mit/python/lib/python3.0/idlelib/configSectionNameDialog.pyu   OkO   s    c             C   s   d |  _  |  j   d  S(   Nu    (   u   resultu   destroy(   u   selfu   event(    (    u<   /mit/python/lib/python3.0/idlelib/configSectionNameDialog.pyu   CancelT   s    	N(   u   __name__u
   __module__u   __init__u   CreateWidgetsu   NameOku   Noneu   Oku   Cancel(   u
   __locals__(    (    u<   /mit/python/lib/python3.0/idlelib/configSectionNameDialog.pyu   GetCfgSectionNameDialog   s
   
			u   GetCfgSectionNameDialogu   __main__c              C   s)   d }  t  t d d  } t | j  d  S(   Nu    u   Get Nameu:   The information here should need to be word wrapped. Test.(   u   GetCfgSectionNameDialogu   rootu   printu   result(   u   keySequ   dlg(    (    u<   /mit/python/lib/python3.0/idlelib/configSectionNameDialog.pyu   run[   s    		u   textu   Dialogu   command(   u   __doc__u   tkinteru   tkinter.messageboxu
   messageboxu   tkMessageBoxu   Toplevelu   GetCfgSectionNameDialogu   __name__u   Tku   rootu   runu   Buttonu   packu   mainloop(    (    (    u<   /mit/python/lib/python3.0/idlelib/configSectionNameDialog.pyu   <module>   s   
P		