Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/idlelib/textView.pyo

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��Qc@sGdZddlTddlZdefd��YZed�Zded�Ze	dkrCe
�Zejd	�d
Z
ee
d�j�Zeedd
dd��Zejde�eedddd��Zejde�eedddd��Zejde�eedddej�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.pyRs(
		

	


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	takefocustorientthighlightthicknessitwrapRRtyscrollcommandtsidetfilltexpand(tFrametSUNKENtButtonRtFALSEtbuttonOkt	ScrollbartVERTICALt
scrollbarViewtTexttWORDRRRRtyviewtsettpacktRIGHTtYtLEFTtTRUEtBOTHtBOTTOMtXtTOP(Rt	frameTexttframeButtons((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(tcodecstopentIOErrorttkMessageBoxt	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	


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.