ó {fc@sŸdZddlTddlZdefd„ƒYZed„Zded„Ze dkr›ddl Z e j d d d d 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 cCs5tj||ƒ|jddƒ|jddd|jƒd|jƒ|sQdndfƒd|_d |_|jƒ|j |ƒ|j d |j ƒ||_ |j jƒ|jd |j ƒ|jd |j ƒ|j jd |ƒ|j jdtƒ||_|jr1|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. t borderwidthis =%dx%d+%d+%diîiôi ids#ffffffs#000000tWM_DELETE_WINDOWssgtstateN(tToplevelt__init__t configuretgeometryt winfo_rootxt winfo_rootytbgtfgt CreateWidgetsttitletprotocoltOktparentttextViewt focus_settbindtinserttconfigtDISABLEDtis_modalt transienttgrab_sett wait_window(tselfRRttexttmodalt_htest((s(/usr/lib64/python2.7/idlelib/textView.pyR s*  !          c CsCt|dtddƒ}t|ƒ}t|ddd|jdtƒ|_t|dtdtd d ƒ|_t |d t d d d |j d |j ƒ|_ |jjd|j jƒ|j jd|jjƒ|jjƒ|jjdtdtƒ|j jdtdtdtƒ|jdtdtƒ|jdtdtdtƒdS(Ntrelieftheighti¼RtClosetcommandt takefocustorientthighlightthicknessitwrapR R tyscrollcommandtsidetfilltexpand(tFrametSUNKENtButtonRtFALSEtbuttonOkt ScrollbartVERTICALt scrollbarViewtTexttWORDR R RRtyviewtsettpacktRIGHTtYtLEFTtTRUEtBOTHtBOTTOMtXtTOP(Rt frameTextt frameButtons((s(/usr/lib64/python2.7/idlelib/textView.pyR 0s  cCs$|jr|jƒn|jƒdS(N(Rt grab_releasetdestroy(Rtevent((s(/usr/lib64/python2.7/idlelib/textView.pyRAs  N( t__name__t __module__t__doc__tTruetFalseRR tNoneR(((s(/usr/lib64/python2.7/idlelib/textView.pyRs$ cCst||||ƒS(N(R(RRRR((s(/usr/lib64/python2.7/idlelib/textView.pyt view_textGscCs¼y:|r*ddl}|j|dƒ}nt|dƒ}Wnbtk rmtjdddd|d|ƒnKtk rž}tdddt|ƒd|ƒnXt|||jƒ|ƒSdS( NiÿÿÿÿtrRsFile Load ErrortmessagesUnable to load file %r .RsUnicode Decode Error( tcodecstopentIOErrort tkMessageBoxt showerrortUnicodeDecodeErrortstrRLtread(RRtfilenametencodingRROttextFileterr((s(/usr/lib64/python2.7/idlelib/textView.pyt view_fileJs       t__main__sidlelib.idle_test.test_textviewt verbosityitexit(trun(RHtTkinterRRRRRIRLRKR[RFtunittesttmainRJtidlelib.idle_test.htestR_(((s(/usr/lib64/python2.7/idlelib/textView.pyts  ?