mς
­fIc           @   sy   d  Z  d k Td k Z d e f d     YZ e d j o< e   Z d   Z e	 e d d d	 e i
   e i   n d S(
   s~   
Dialog that allows user to specify a new config file section name.
Used to get new highlight theme and keybinding set names.
(   t   *Nt   GetCfgSectionNameDialogc           B   s;   t  Z d   Z d   Z d   Z d  d  Z d  d  Z RS(   Nc         C   s>  t  i |  |  |  i d d  |  i d t d t  |  i |  |  i |  |  i	   |  i
 d |  i  | |  _ | |  _ | |  _ d |  _ |  i   |  i   |  i   |  i i d |  i i    |  i d | i   | i   d |  i   d | i   | i   d |  i   d f  |  i   |  i   d	 S(
   s   
        message - string, informational message to display
        usedNames - list, list of names already in use for validity check
        t   borderwidthi   t   heightt   widtht   WM_DELETE_WINDOWt    s   +%d+%di   N(   t   Toplevelt   __init__t   selft   parentt	   configuret	   resizablet   FALSEt   titlet	   transientt   grab_sett   protocolt   Cancelt   messaget	   usedNamest   resultt   CreateWidgetst   withdrawt   update_idletaskst   messageInfot   configt	   frameMaint   winfo_reqwidtht   geometryt   winfo_rootxt   winfo_widtht   winfo_rootyt   winfo_heightt   winfo_reqheightt	   deiconifyt   wait_window(   R	   R
   R   R   R   (    (    t<   /mit/python/lib/python2.4/idlelib/configSectionNameDialog.pyR   	   s&     
				


[
c         C   s  t  |   |  _ t  |   |  _ t |  d d d t |  _ |  i i d t d t	 d t
  t |  i d t d t d	 d
 d d
 d |  i |  _ t |  i d |  i d d } | i   |  i i d	 d
 d d
  | i d	 d
 d d
  t |   } | i d t d t  t | d d d d d |  i |  _ |  i i d d d d d	 d
 d d
  t | d d d d d |  i |  _ |  i i d d d d d	 d
 d d
  d  S(   NR   i   t   relieft   sidet   expandt   fillt   anchort   justifyt   padxi   t   padyt   textt   textvariableR   i   t   Oki   t   commandt   rowi    t   columnR   i   (   t	   StringVarR	   t   namet   fontSizet   Framet   SUNKENR   t   packt   TOPt   TRUEt   BOTHt   Messaget   Wt   LEFTR   R   t   Entryt	   entryNamet	   focus_sett   frameButtonst   BOTTOMt   Xt   ButtonR0   t   buttonOkt   gridR   t   buttonCancel(   R	   RC   RA   (    (    R%   R   &   s$    !
%c         C   sΓ   d } |  i i   } | i   | p& t i d d d d d |   d } nt t |  d j o* t i d d d d	 d
 d |   d } n7 | |  i j o& t i d d d d d |   d } n | S(   Ni   R   s
   Name ErrorR   s   No name specified.R
   i    i   s)   Name too long. It should be no more than s   30 characters.s   This name is already in use.(	   t   nameOkR	   R5   t   gett   stript   tkMessageBoxt	   showerrort   lenR   (   R	   RJ   R5   (    (    R%   t   NameOk:   s"    





c         C   s7   |  i   o& |  i i   i   |  _ |  i   n d  S(   N(   R	   RP   R5   RK   RL   R   t   destroy(   R	   t   event(    (    R%   R0   O   s    c         C   s   d |  _ |  i   d  S(   NR   (   R	   R   RQ   (   R	   RR   (    (    R%   R   T   s    	(   t   __name__t
   __module__R   R   RP   t   NoneR0   R   (    (    (    R%   R      s
   			t   __main__c          C   s$   d } t t d d  }  |  i GHd  S(   NR   s   Get Names:   The information here should need to be word wrapped. Test.(   t   keySeqR   t   roott   dlgR   (   RY   RW   (    (    R%   t   run[   s    		R.   t   DialogR1   (   t   __doc__t   TkinterRM   R   R   RS   t   TkRX   RZ   RF   R9   t   mainloop(   RZ   R   RM   RX   (    (    R%   t   ?   s   	P		