Your IP : 216.73.216.213


Current Path : /opt/alt/python33/lib64/python3.3/Tools/pynche/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/Tools/pynche/__pycache__/TextViewer.cpython-33.pyo

�
��f�c@s9dZddlTddlZdZGdd�d�ZdS(u(TextViewer class.

The TextViewer allows you to see how the selected color would affect various
characteristics of a Tk text widget.  This is an output viewer only.

In the top part of the window is a standard text widget with some sample text
in it.  You are free to edit this text in any way you want (BAW: allow you to
change font characteristics).  If you want changes in other viewers to update
text characteristics, turn on Track color changes.

To select which characteristic tracks the change, select one of the radio
buttons in the window below.  Text foreground and background affect the text
in the window above.  The Selection is what you see when you click the middle
button and drag it through some text.  The Insertion is the insertion cursor
in the text window (which only has a background).
i(u*NuText Window...cBs�|EeZdZddd�Zddd�Zddd�Zddd�Zdd	d
�Zddd�Z	dd
d�Z
dd�Zdd�ZdS(u
TextViewercCsC||_|j�}t|dd�}|_|jd|j�|jd�|jd�|jd|j	�|jd|j	�|jd|j�|jd|j�t
|d	td
|jdd�d
|jdd�dddd�|_
|jd�}|r|j
jd|�n|jd�}|rB|j
jd|�n|jd�}|rm|j
jd|�n|j
j�|j
jd|jdd��|jd�}|r�|j
jt|�ny8|jddtf�\}	}
|j
jt|	|
�Wntk
rYnX|j
j�t�|_|jj|jd d!��t�|_|jj|jd"d!��t|d#d$d%|jd	td&|j�|_ |j jd't!d(t"�t#|�}|_$|j�g|_%d)}xVd6D]N}
t&|d#|
�}|j'd-|d.d!d/t(�|j%j)|�|d07}q�Wd0}xPd7D]H}
t&|d#|
�}|j'd-d0d.|�|j%j)|�|d07}qFWg|_*x�d8D]�}x�d9D]~}|d4kr�|d0kr�q�nt+|d%|jd5|d)d)|d0d&|j,�}|j'd-|d.|�|j*j)|�q�Wq�W|j�dS(:Nuclass_uPyncheuWM_DELETE_WINDOWuPynche Text Windowu<Alt-q>u<Alt-Q>u<Alt-w>u<Alt-W>ureliefu
backgrounduTEXTBGublacku
foregrounduTEXTFGuwhiteuwidthi#uheightiuTEXT_SFGuselectforegrounduTEXT_SBGuselectbackgrounduTEXT_IBGuinsertbackgroundguTEXTu�Insert some stuff here and play
with the buttons below to see
how the colors interact in
textual displays.

See how the selection can also
be affected by tickling the buttons
and choosing a color.uTEXTINSuTEXTSELg@uTRACKPiuWHICHutextuTrack color changesuvariableucommandufilluexpandiuText:u
Selection:u
Insertion:urowucolumnustickyiu
Foregroundu
Backgroundiiuvalue(uText:u
Selection:u
Insertion:(u
Foregroundu
Background(ii(iii(-u_TextViewer__sbuoptiondbuToplevelu_TextViewer__rootuprotocoluwithdrawutitleuiconnameubindu_TextViewer__quituTextuSUNKENugetu_TextViewer__textu	configureupackuinsertumark_setuINSERTuENDutag_adduSELu
ValueErroru	focus_setu
BooleanVaru_TextViewer__trackpusetuIntVaru_TextViewer__whichuCheckbuttonuGROOVEu_TextViewer__toggletracku_TextViewer__tuXuYESuFrameu_TextViewer__frameu_TextViewer__labelsuLabelugriduEuappendu_TextViewer__radiosuRadiobuttonu_TextViewer__set_color(uselfuswitchboardumasteruoptiondburootusfgusbguibguinsertustartuenduframeurowutextulucolur((u</opt/alt/python33/lib64/python3.3/Tools/pynche/TextViewer.pyu__init__s�	





	
	

	

uTextViewer.__init__cCs|jj�dS(N(u_TextViewer__rootuquit(uselfuevent((u</opt/alt/python33/lib64/python3.3/Tools/pynche/TextViewer.pyu__quitvsuTextViewer.__quitcCs|jj�dS(N(u_TextViewer__rootuwithdraw(uselfuevent((u</opt/alt/python33/lib64/python3.3/Tools/pynche/TextViewer.pyuwithdrawysuTextViewer.withdrawcCs|jj�dS(N(u_TextViewer__rootu	deiconify(uselfuevent((u</opt/alt/python33/lib64/python3.3/Tools/pynche/TextViewer.pyu	deiconify|suTextViewer.deiconifycCs|jj�dS(N(u_TextViewer__sbuupdate_views_current(uselfuevent((u</opt/alt/python33/lib64/python3.3/Tools/pynche/TextViewer.pyu
__forceupdatesuTextViewer.__forceupdatecCs�|jj�r)t}|jdd}nt}|jdd}x!|jD]}|jd|�qJWx!|jD]}|jd|�qnWdS(Niu
foregroundudisabledforegroundustate(u_TextViewer__trackpugetuNORMALu_TextViewer__radiosuDISABLEDu	configureu_TextViewer__labels(uselfueventustateufgurul((u</opt/alt/python33/lib64/python3.3/Tools/pynche/TextViewer.pyu
__toggletrack�suTextViewer.__toggletrackcCs|jj�}|j}|dkr1|d}nd|dkrJ|d}nK|dkrc|d}n2|dkr||d}n|d	kr�|d
}nytj|�\}}}Wn6tjk
r�|jj�j|�\}}}YnX|jj	|||�dS(Niu
foregroundiu
backgroundiuselectforegroundiuselectbackgroundiuinsertbackground(
u_TextViewer__whichugetu_TextViewer__textuColorDBurrggbb_to_tripletuBadColoru_TextViewer__sbucolordbufind_bynameuupdate_views(uselfueventuwhichutextucoloruredugreenublue((u</opt/alt/python33/lib64/python3.3/Tools/pynche/TextViewer.pyu__set_color�s"	




&uTextViewer.__set_colorcCs�|jj�r�tj|||f�}|jj�}|j}|dkr^|jd|�q�|dkr}|jd|�q�|dkr�|jd|�q�|dkr�|jd|�q�|d	kr�|jd
|�q�ndS(Niu
foregroundiu
backgroundiuselectforegroundiuselectbackgroundiuinsertbackground(u_TextViewer__trackpugetuColorDButriplet_to_rrggbbu_TextViewer__whichu_TextViewer__textu	configure(uselfuredugreenublueu	colornameuwhichutext((u</opt/alt/python33/lib64/python3.3/Tools/pynche/TextViewer.pyuupdate_yourself�s	uTextViewer.update_yourselfcCs�|jj�|d<|jj�|d<|jjdd�|d<|jjt�dd�|d<|jjt�|d	<|jd
|d<|jd|d
<|jd|d<|jd|d<|jd|d<dS(NuTRACKPuWHICHguend - 1cuTEXTiiuTEXTSELuTEXTINSu
foregrounduTEXTFGu
backgrounduTEXTBGuselectforegrounduTEXT_SFGuselectbackgrounduTEXT_SBGuinsertbackgrounduTEXT_IBG(u_TextViewer__trackpugetu_TextViewer__whichu_TextViewer__textu
tag_rangesuSELuindexuINSERT(uselfuoptiondb((u</opt/alt/python33/lib64/python3.3/Tools/pynche/TextViewer.pyusave_options�s uTextViewer.save_optionsN(
u__name__u
__module__u__qualname__uNoneu__init__u_TextViewer__quituwithdrawu	deiconifyu_TextViewer__forceupdateu_TextViewer__toggletracku_TextViewer__set_coloruupdate_yourselfusave_options(u
__locals__((u</opt/alt/python33/lib64/python3.3/Tools/pynche/TextViewer.pyu
TextViewers\u
TextViewer(u__doc__utkinteruColorDBu	ADDTOVIEWu
TextViewer(((u</opt/alt/python33/lib64/python3.3/Tools/pynche/TextViewer.pyu<module>s