AlkantarClanX12

Your IP : 18.118.149.55


Current Path : /opt/alt/python35/lib64/python3.5/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/idlelib/__pycache__/textView.cpython-35.opt-1.pyc



��Yf[
�@s�dZddlTddljZGdd�de�Zddd�Zddd	d
�Ze	dkr�ddl
Z
e
jdd
ddd�ddlm
Z
e
e�dS)zSimple text browser for IDLE

�)�*Nc@sCeZdZdZdddd�Zdd�Zdd	d
�ZdS)�
TextViewerz*A simple text viewer dialog for IDLE

    TFcCs&tj||�|jdd�|jddd|j�d|j�|sQdndf�d|_d	|_|j�|j	|�|j
d
|j�||_|j
j�|jd|j�|jd|j�|j
jd
|�|j
jdt�|r"|j|�|j�|j�dS)aHShow the given text in a scrollable window with a 'close' button

        If modal option set to False, user can interact with other windows,
        otherwise they will be unable to interact with other windows until
        the textview window is closed.

        _htest - bool; change box location when running htest.
        Zborderwidth�z=%dx%d+%d+%di�i��
�dz#ffffffz#000000ZWM_DELETE_WINDOWz<Return>z<Escape>g�stateN)�Toplevel�__init__Z	configureZgeometryZwinfo_rootxZwinfo_rooty�bg�fg�
CreateWidgets�titleZprotocol�Ok�parent�textViewZ	focus_setZbind�insert�configZDISABLEDZ	transientZgrab_setZwait_window)�selfrr
�text�modalZ_htest�r�5/opt/alt/python35/lib64/python3.5/idlelib/textView.pyr	s(	
!		

	


zTextViewer.__init__c
CsCt|dtdd�}t|�}t|ddd|jdt�|_t|dtdtd	d
�|_t	|dt
d	d
d|jd
|j�|_
|jjd|j
j�|j
jd|jj�|jj�|jjdtdt�|j
jdtdtdt�|jdtdt�|jdtdtdt�dS)NZreliefZheighti�rZCloseZcommandZ	takefocusZorientZhighlightthicknessrZwraprr
ZyscrollcommandZsideZfill�expand)ZFrameZSUNKENZButtonrZFALSEZbuttonOkZ	ScrollbarZVERTICALZ
scrollbarViewZTextZWORDrr
rrZyview�setZpackZRIGHT�YZLEFTZTRUEZBOTHZBOTTOM�XZTOP)rZ	frameTextZframeButtonsrrrr/s
zTextViewer.CreateWidgetsNcCs|j�dS)N)Zdestroy)rZeventrrrr@sz
TextViewer.Ok)�__name__�
__module__�__qualname__�__doc__r	rrrrrrrs#rTcCst||||�S)N)r)rr
rrrrr�	view_textDsr cCs�y/t|dd|��}|j�}WdQRXWnxtk
rctjdddd|d|�YnZtk
r�}z'tjdddt|�d|�WYdd}~XnXt||||�SdS)	N�r�encodingr
zFile Load Error�messagezUnable to load file %r .rzUnicode Decode Error)�open�read�IOError�tkMessageBoxZ	showerror�UnicodeDecodeError�strr )rr
�filenamer"r�file�contents�errrrr�	view_fileGs

r.�__main__zidlelib.idle_test.test_textview�	verbosity��exitF)�run)rZtkinterZtkinter.messageboxZ
messageboxr'rrr r.rZunittest�mainZidlelib.idle_test.htestr3rrrr�<module>s
<