Your IP : 18.188.218.134
���]� � @ s~ d d l Td d l j Z Gd d � d e � Z e d k rz d d l Z e j d d d d d
�d d l m
Z
e
e � d S)� )�*Nc @ sU e Z d Z d d d � Z d d � Z d d � Z d d d
� Z d d d � Z d S)
�GetCfgSectionNameDialogFc C sA t j | | � | j d d � | j d t d t � | j | � | j | � | j � | j d | j � | | _
| | _ | | _ | j
� | j � | j � | j j d | j j � � | j d | j � | j � d | j � d | j � | s| j � d | j � d n d f � | j � | j � d S) N�borderwidth� Zheight�widthZWM_DELETE_WINDOWz+%d+%d� �d )�Toplevel�__init__Z configureZ resizable�FALSE�titleZ transientZgrab_set�protocol�Cancel�parent�message�
used_names�create_widgetsZwithdrawZupdate_idletasks�messageInfo�config� frameMainZwinfo_reqwidthZgeometryZwinfo_rootxZwinfo_widthZwinfo_rootyZwinfo_heightZwinfo_reqheightZ deiconifyZwait_window)�selfr r r r Z_htest� r �</opt/alt/python35/lib64/python3.5/configSectionNameDialog.pyr
s,
0
z GetCfgSectionNameDialog.__init__c C s� t | j � | _ t | j � | _ 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 | d d �} | j d t � t | d d d d d | j �| _ | j j d t
d d
� t | d d d d d | j �| _ | j j d t d d
� d S)Nr r ZreliefZside�expand�fillZanchorZjustifyZpadxr Zpady�textZtextvariabler � �Ok� Zcommandr )Z StringVarr �nameZfontSizeZFrameZSUNKENr �packZTOP�TRUEZBOTHZMessage�WZLEFTr r ZEntryZ focus_setZBOTTOMZButtonr ZbuttonOkr ZbuttonCancelZRIGHT)r Z entryNameZframeButtonsr r r r + s$
z&GetCfgSectionNameDialog.create_widgetsc C s� | j j � j � } | s: t j d d d d d | � nl t | � d k ru t j d d d d d d | � d } n1 | | j k r� t j d d d d
d | � d } | S)Nr z
Name Errorr zNo name specified.r r z)Name too long. It should be no more than z30 characters.� zThis name is already in use.)r �get�strip�tkMessageBoxZ showerror�lenr )r r r r r �name_ok@ s
zGetCfgSectionNameDialog.name_okNc C s) | j � } | r% | | _ | j � d S)N)r( �result�destroy)r �eventr r r r r S s zGetCfgSectionNameDialog.Okc C s d | _ | j � d S)Nr# )r) r* )r r+ r r r r Y s zGetCfgSectionNameDialog.Cancel)�__name__�
__module__�__qualname__r
r r( r r r r r r r
s
r �__main__z"idlelib.idle_test.test_config_name� verbosityr �exitF)�run)�tkinterZtkinter.messageboxZ
messageboxr&