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

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


�`^c@s�dZddlTddlZdefd��YZed�Zded�Ze	dkr�ddl
Z
e
jd	d
dde�dd
l
mZee�ndS(sSimple text browser for IDLE

i�(t*Nt
TextViewercBs2eZdZeed�Zd�Zdd�ZRS(s*A simple text viewer dialog for IDLE

    cCs)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�ndS(sHShow 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.
        tborderwidthis=%dx%d+%d+%diqi�i
ids#ffffffs#000000tWM_DELETE_WINDOWs<Return>s<Escape>gtstateN(tToplevelt__init__t	configuretgeometrytwinfo_rootxtwinfo_rootytbgtfgt
CreateWidgetsttitletprotocoltOktparentttextViewt	focus_settbindtinserttconfigtDISABLEDt	transienttgrab_settwait_window(tselfRRttexttmodalt_htest((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__tTruetFalseRR
tNoneR(((s&/sys/lib/python2.7/idlelib/textView.pyRs#	cCst||||�S(N(R(RRRR((s&/sys/lib/python2.7/idlelib/textView.pyt	view_textDscCs�y:|r*ddl}|j|d�}nt|d�}Wn1tk
rmtjdddd|d|�nXt|||j�|�SdS(Ni�trRsFile Load ErrortmessagesUnable to load file %r .R(tcodecstopentIOErrorttkMessageBoxt	showerrorRJtread(RRtfilenametencodingRRMttextFile((s&/sys/lib/python2.7/idlelib/textView.pyt	view_fileGs

t__main__sidlelib.idle_test.test_textviewt	verbosityitexit(trun(RFtTkinterRPRRRGRJRIRVRDtunittesttmainRHtidlelib.idle_test.htestRZ(((s&/sys/lib/python2.7/idlelib/textView.pyt<module>s
<

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.