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__/ListViewer.cpython-33.pyo

�
��f�c@s9dZddlTddlZdZGdd�d�ZdS(uListViewer class.

This class implements an input/output view on the color model.  It lists every
unique color (e.g. unique r/g/b value) found in the color database.  Each
color is shown by small swatch and primary color name.  Some colors have
aliases -- more than one name for the same r/g/b value.  These aliases are
displayed in the small listbox at the bottom of the screen.

Clicking on a color name or swatch selects that color and updates all other
windows.  When a color is selected in a different viewer, the color list is
scrolled to the selected color and it is highlighted.  If the selected color
is an r/g/b value without a name, no scrolling occurs.

You can turn off Update On Click if all you want to see is the alias for a
given name, without selecting the color.
i(u*NuColor %List Window...cBs�|EeZdZddd�Zdd�Zddd�Zddd�Zdd	d
�Zddd�Z	dd
d�Z
dd�Zdd�Zdd�Z
dS(u
ListViewerc
Cs=||_|j�}d|_d|_t|dd�}|_|jd|j�|j	d�|j
d�|jd|j�|jd|j�|jd|j�|jd	|j�t
|�}|_|j�t|d
ddd
dddt�}|_t|�|_|jjdtdt�|jdtdd�|jd|jdf�|jjd|df�|j�t�|_|jj|jdd��t|ddd|jd|j�|_ |j jdddt�t!|dd�|_"|j"j�t#|dddt$�|_%|j%jdddt�dS( Niuclass_uPyncheuWM_DELETE_WINDOWuPynche Color Listu<Alt-q>u<Alt-Q>u<Alt-w>u<Alt-W>uwidthi�uheighti,uborderwidthiureliefufillusideuexpandiuyscrollcommandusetucommanduyviewu	UPONCLICKutextuUpdate on ClickuvariableuAliases:iu
selectmode(&u_ListViewer__sbuoptiondbuNoneu_ListViewer__lastboxu_ListViewer__dontcenteruToplevelu_ListViewer__rootuprotocoluwithdrawutitleuiconnameubindu_ListViewer__quituFrameu_ListViewer__frameupackuCanvasuSUNKENu_ListViewer__canvasu	Scrollbaru_ListViewer__scrollbaruYuRIGHTuBOTHu	configureu_ListViewer__populateu
BooleanVaru_ListViewer__uocusetugetuCheckbuttonu_ListViewer__toggleupdateu_ListViewer__uocbtnuLabelu_ListViewer__alabeluListboxuBROWSEu_ListViewer__aliases(uselfuswitchboardumasteruoptiondburootuframeucanvas((u</opt/alt/python33/lib64/python3.3/Tools/pynche/ListViewer.pyu__init__sD			



		
uListViewer.__init__cCs�|jj�}|j}d}d}g}|_x|j�D]}tj|j|��}|jd|ddd|ddd|�|j	d|ddd|dt
�}|j|�\}	}
}}|jd	|dd	|d	|dd
ddd
|df�}
|jd|j
�|j|
�|d	|krD|d	}n|d7}q>W|ddd}|jdddd|f�xB|D]:}|j|�\}	}
}}|j||	|
||�q�WdS(Niiiufillii
utextuanchoriiuoutlineuutagsuallu<ButtonRelease>iuscrollregioni�(u_ListViewer__sbucolordbu_ListViewer__canvasu_ListViewer__bboxesuunique_namesuColorDButriplet_to_rrggbbufind_bynameucreate_rectangleucreate_textuWubboxubindu_ListViewer__onreleaseuappenduconfigucoords(uselfucolordbucanvasurowuwidestubboxesunameu
exactcolorutextidux1uy1utextenduy2uboxidu
canvheightuboxux2((u</opt/alt/python33/lib64/python3.3/Tools/pynche/ListViewer.pyu
__populateDs8	
	


uListViewer.__populatecCs%|j}|j|j�}|j|j�}|j||||�}x%|D]}||jkrLPqLqLWdS|jj|�}x&|D]}|ddkr�Pq�q�WdStj	|�\}	}
}d|_
|jj�r�|j
j|	|
|�n0|j|	|
|�|	|
||_|_|_dS(Niu#i(u_ListViewer__canvasucanvasxuxucanvasyuyufind_overlappingu_ListViewer__bboxesugettagsuColorDBurrggbb_to_tripletu_ListViewer__dontcenteru_ListViewer__uocugetu_ListViewer__sbuupdate_viewsuupdate_yourselfu_ListViewer__redu_ListViewer__greenu_ListViewer__blue(uselfueventucanvasuxuyuidsuboxidutagsuturedugreenublue((u</opt/alt/python33/lib64/python3.3/Tools/pynche/ListViewer.pyu__onreleaseds&	

	uListViewer.__onreleasecCs5|jj�r1|jj|j|j|j�ndS(N(u_ListViewer__uocugetu_ListViewer__sbuupdate_viewsu_ListViewer__redu_ListViewer__greenu_ListViewer__blue(uselfuevent((u</opt/alt/python33/lib64/python3.3/Tools/pynche/ListViewer.pyu__toggleupdatesuListViewer.__toggleupdatecCs|jj�dS(N(u_ListViewer__rootuquit(uselfuevent((u</opt/alt/python33/lib64/python3.3/Tools/pynche/ListViewer.pyu__quit�suListViewer.__quitcCs|jj�dS(N(u_ListViewer__rootuwithdraw(uselfuevent((u</opt/alt/python33/lib64/python3.3/Tools/pynche/ListViewer.pyuwithdraw�suListViewer.withdrawcCs|jj�dS(N(u_ListViewer__rootu	deiconify(uselfuevent((u</opt/alt/python33/lib64/python3.3/Tools/pynche/ListViewer.pyu	deiconify�suListViewer.deiconifycCs�|j}|jr+|j|jdd�ntj|||f�}|j|dd�||_|jjdt�y,|jj	�j
|||�dd�}Wn,tjk
r�|jjtd�dSYnX|s�|jjtd�n$x!|D]}|jjt|�q�W|j
r"d|_
ni|j|�\}}}}	|j|jd�\}}}}
t|d�d	}|jd
|	||
�dS(Nuoutlineuublackiiu<no matching color>u<no aliases>uheightg�?umovetoi����(u_ListViewer__canvasu_ListViewer__lastboxu
itemconfigureuColorDButriplet_to_rrggbbu_ListViewer__aliasesudeleteuENDu_ListViewer__sbucolordbu
aliases_ofuBadColoruinsertu_ListViewer__dontcenterucoordsu_ListViewer__bboxesuintuyview(uselfuredugreenublueucanvasucolortagualiasesunameuiguy1uy2uh((u</opt/alt/python33/lib64/python3.3/Tools/pynche/ListViewer.pyuupdate_yourself�s,			,	
	"uListViewer.update_yourselfcCs|jj�|d<dS(Nu	UPONCLICK(u_ListViewer__uocuget(uselfuoptiondb((u</opt/alt/python33/lib64/python3.3/Tools/pynche/ListViewer.pyusave_options�suListViewer.save_optionscCs|jjd�|j�dS(Nuall(u_ListViewer__canvasudeleteu_ListViewer__populate(uselfucolordb((u</opt/alt/python33/lib64/python3.3/Tools/pynche/ListViewer.pyucolordb_changed�suListViewer.colordb_changedN(u__name__u
__module__u__qualname__uNoneu__init__u_ListViewer__populateu_ListViewer__onreleaseu_ListViewer__toggleupdateu_ListViewer__quituwithdrawu	deiconifyuupdate_yourselfusave_optionsucolordb_changed(u
__locals__((u</opt/alt/python33/lib64/python3.3/Tools/pynche/ListViewer.pyu
ListViewers, u
ListViewer(u__doc__utkinteruColorDBu	ADDTOVIEWu
ListViewer(((u</opt/alt/python33/lib64/python3.3/Tools/pynche/ListViewer.pyu<module>s