Your IP : 3.135.247.24


Current Path : /opt/alt/python36/lib64/python3.6/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/__pycache__/textview.cpython-36.opt-2.pyc

3

��2a��@s�ddlmZmZmZmZmZmZmZmZm	Z	ddl
mZmZm
Z
ddlmZddlmZGdd�de�ZGdd�de�ZGd	d
�d
e�ZGdd�de�Zddd�Zddd�Zedkr�ddlmZedddd�ddlmZee�dS)�)	�Toplevel�Text�TclError�
HORIZONTAL�VERTICAL�N�S�E�W)�Frame�	Scrollbar�Button)�	showerror)�color_configcs,eZdZ�fdd�Zdd�Zdd�Z�ZS)�AutoHiddenScrollbarcs<t|�dkst|�dkr"|j�n|j�t�j||�dS)Ngg�?)�float�gridZgrid_remove�super�set)�self�lo�hi)�	__class__��-/opt/alt/python36/lib64/python3.6/textview.pyrs
zAutoHiddenScrollbar.setcKst|jj�d���dS)Nz does not support "pack")rr�__name__)r�kwargsrrr�packszAutoHiddenScrollbar.packcKst|jj�d���dS)Nz does not support "place")rrr)rrrrr�placeszAutoHiddenScrollbar.place)r�
__module__�__qualname__rrr�
__classcell__rr)rrrsrcseZdZd�fdd�	Z�ZS)�	TextFrame�wordcst�j|�d|d<d|d<t||dd�|_}t|�|jddtttt	d�|j
ddd	�|jddd	�|jd
|�d|d<|j
�t|td
|jd�|_}|j|d<|jddttd�|dk�rt|td
|jd�|_}|j|d<|jddtt	d�dS)NZsunkenZreliefi�Zheightr)�wrapZhighlightthickness)�row�columnZsticky�)ZweightgZdisabled�stateF)Zorient�	takefocus�commandZyscrollcommandZnoneZxscrollcommand)r�__init__r�textrrrrr	r
Zgrid_rowconfigureZgrid_columnconfigure�insertZ	focus_setrrZyview�yscrollrrZxview�xscroll)r�parentZrawtextr$r,r.r/)rrrr+"s,


zTextFrame.__init__)r#)rrr r+r!rr)rrr"sr"cs(eZdZd�fdd�	Zddd�Z�ZS)	�	ViewFramer#csxt�j|�||_|jd|j�|jd|j�t|||d�|_t|d|jdd�|_}|jj	ddd	d
�|j	dd�dS)
Nz<Return>z<Escape>)r$�CloseF)r,r*r)�topT�both)�side�expand�fillZbottom)r5)
rr+r0Zbind�okr"Z	textframer
�	button_okr)rr0r,r$r9)rrrr+GszViewFrame.__init__NcCs|jj�dS)N)r0�destroy)r�eventrrrr8RszViewFrame.ok)r#)N)rrr r+r8r!rr)rrr1Esr1cs0eZdZd
ddd��fdd�Zddd	�Z�ZS)�
ViewWindowTr#F)�_htest�_utestcs�t�j|�d|d<|j�d}|j�|s.dnd}	|jd|�d|	���|j|�t|||d�|_|jd|j	�t
|d	|j	d
d�|_}
|jjdd
dd�||_
|j
r�|j|�|j�|s�|j�dS)N�Zborderwidth�
�dz	=750x500+�+)r$ZWM_DELETE_WINDOWr2F)r,r*r)r3Tr4)r5r6r7)rr+Zwinfo_rootxZwinfo_rootyZgeometry�titler1Z	viewframeZprotocolr8r
r9r�is_modalZ	transientZgrab_setZwait_window)rr0rCr,�modalr$r=r>�x�yr9)rrrr+Zs"

zViewWindow.__init__NcCs|jr|j�|j�dS)N)rDZgrab_releaser:)rr;rrrr8}sz
ViewWindow.ok)Tr#)N)rrr r+r8r!rr)rrr<Ws"r<Tr#FcCst||||||d�S)N)r$r>)r<)r0rCr,rEr$r>rrr�	view_text�srHc
Cs�y&t|d|d��}|j�}WdQRXWn\tk
rPtdd|�d�|d�YnHtk
r�}	ztdt|	�|d�WYdd}	~	XnXt||||||d�SdS)	N�r)�encodingzFile Load ErrorzUnable to load file z .)rC�messager0zUnicode Decode Error)r$r>)�open�read�OSErrorr�UnicodeDecodeError�strrH)
r0rC�filenamerJrEr$r>�file�contents�errrrr�	view_file�s
rU�__main__)�mainzidlelib.idle_test.test_textview�)�	verbosity�exit)�runN)Tr#F)Tr#F)Ztkinterrrrrrrrr	r
Ztkinter.ttkrrr
Ztkinter.messageboxrZidlelib.colorizerrrr"r1r<rHrUrZunittestrWZidlelib.idle_test.htestr[rrrr�<module>s,&-



?>