��Qc@sGdZddlTddlZdefd��YZed�Zded�Ze dkrCe
�Zejd �d
Z
ee
d�j�Zeedd
dd��Zejde�eedddd��Zejde�eedddd��Zejde�eedddej�Zejde�ej�ndS(sSimple text browser for IDLE
i�(t*Nt
TextViewercBs/eZdZed�Zd�Zdd�ZRS(s*A simple text viewer dialog for IDLE
cCstj||�|jdd�|jddd|j�d|j�df�d|_d|_|j�|j |�|j
d |j�||_|j
j�|jd
|j�|jd|j�|j
jd|�|j
jd
t�|r|j|�|j�|j�ndS(sJShow the given text in a scrollable window with a 'close' button
tborderwidthis=%dx%d+%d+%diqi�i
s#ffffffs#000000tWM_DELETE_WINDOWs<Return>s<Escape>gtstateN(tToplevelt__init__t configuretgeometrytwinfo_rootxtwinfo_rootytbgtfgt
CreateWidgetsttitletprotocoltOktparentttextViewt focus_settbindtinserttconfigtDISABLEDt transienttgrab_settwait_window(tselfRRttexttmodal((s&/sys/lib/python2.7/idlelib/textView.pyRs(
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(Ntrelieftheighti�RtClosetcommandt takefocustorientthighlightthicknessitwrapRRtyscrollcommandtsidetfilltexpand(tFrametSUNKENtButtonRtFALSEtbuttonOkt ScrollbartVERTICALt
scrollbarViewtTexttWORDRRRRtyviewtsettpacktRIGHTtYtLEFTtTRUEtBOTHtBOTTOMtXtTOP(Rt frameTexttframeButtons((s&/sys/lib/python2.7/idlelib/textView.pyR
)s
cCs|j�dS(N(tdestroy(Rtevent((s&/sys/lib/python2.7/idlelib/textView.pyR:sN(t__name__t
__module__t__doc__tTrueRR
tNoneR(((s&/sys/lib/python2.7/idlelib/textView.pyRs cCst||||�S(N(R(RRRR((s&/sys/lib/python2.7/idlelib/textView.pyt view_text>scCs�y:|r*ddl}|j|d�}nt|d�}Wn=tk
ryddl}|jdddd|d|�nXt|||j�|�SdS(Ni�trRsFile Load ErrortmessagesUnable to load file %r .R(tcodecstopentIOErrorttkMessageBoxt showerrorRHtread(RRtfilenametencodingRRKttextFileRN((s&/sys/lib/python2.7/idlelib/textView.pyt view_fileAs
t__main__s
textView tests
./textView.pyRIRRHR!cCsttdt�S(NRH(RHtrootR(((s&/sys/lib/python2.7/idlelib/textView.pyt<lambda>XsR'RTcCsttdt�S(NRT(RTRVRQ(((s&/sys/lib/python2.7/idlelib/textView.pyRW[ssnonmodal view_textcCsttdtdt�S(Nsnonmodal view_textR(RHRVRtFalse(((s&/sys/lib/python2.7/idlelib/textView.pyRW^sR (REtTkinterRNRRRFRHRGRTRCtTkRVRRQtfileRPRR,tbtn1R6R9tbtn2tbtn3RAtcloseR7tmainloop(((s&/sys/lib/python2.7/idlelib/textView.pyt<module>s,
6
|