???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
¿œ^c           @   s9   d  Z  d d l Td d l Z d Z d d d „  ƒ  YZ d S(   s  ListViewer 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ÿÿÿÿ(   t   *Ns   Color %List Window...t
   ListViewerc           B   st   e  Z d
 d  „ Z d „  Z d
 d „ Z d
 d „ Z d
 d „ Z d
 d „ Z d
 d „ Z	 d „  Z
 d „  Z d	 „  Z RS(   c      
   C   s=  | |  _  | j ƒ  } d  |  _ d |  _ t | d d ƒ} |  _ | j d |  j ƒ | j	 d ƒ | j
 d ƒ | j d |  j ƒ | j d |  j ƒ | j d |  j ƒ | j d	 |  j ƒ t | ƒ } |  _ | j ƒ  t | d
 d d d d d d t ƒ} |  _ t | ƒ |  _ |  j j d t d t ƒ | j d t d d ƒ | j d |  j d f ƒ |  j j d | d f ƒ |  j ƒ  t ƒ  |  _ |  j j | j d d ƒ ƒ t | d d d |  j d |  j ƒ|  _  |  j  j d d d t ƒ t! | d d ƒ|  _" |  j" j ƒ  t# | d d d t$ ƒ|  _% |  j% j d d d t ƒ d  S(    Ni    t   class_t   Pynchet   WM_DELETE_WINDOWs   Pynche Color Lists   <Alt-q>s   <Alt-Q>s   <Alt-w>s   <Alt-W>t   widthi    t   heighti,  t   borderwidthi   t   relieft   fillt   sidet   expandi   t   yscrollcommandt   sett   commandt   yviewt	   UPONCLICKt   texts   Update on Clickt   variables   Aliases:i   t
   selectmode(&   t   _ListViewer__sbt   optiondbt   Nonet   _ListViewer__lastboxt   _ListViewer__dontcentert   Toplevelt   _ListViewer__roott   protocolt   withdrawt   titlet   iconnamet   bindt   _ListViewer__quitt   Framet   _ListViewer__framet   packt   Canvast   SUNKENt   _ListViewer__canvast	   Scrollbart   _ListViewer__scrollbart   Yt   RIGHTt   BOTHt	   configuret   _ListViewer__populatet
   BooleanVart   _ListViewer__uocR   t   gett   Checkbuttont   _ListViewer__toggleupdatet   _ListViewer__uocbtnt   Labelt   _ListViewer__alabelt   Listboxt   BROWSEt   _ListViewer__aliases(   t   selft   switchboardt   masterR   t   roott   framet   canvas(    (    s7   /usr/lib64/python2.7/site-packages/pynche/ListViewer.pyt   __init__   sD    			

		c         C   sÉ  |  j  j ƒ  } |  j } d } d } g  } |  _ x| j ƒ  D]} t j | j | ƒ ƒ } | j d | d d d | d d d | ƒ| j	 d | d d d | d t
 ƒ} | j | ƒ \ }	 }
 } } | j d	 | d d	 | d	 | d d
 d d d | d f ƒ} | j d |  j ƒ | j | ƒ | d	 | k rD| d	 } n  | d 7} q> W| d d d } | j d d d d | f ƒ xB | D]: } | j | ƒ \ }	 }
 } } | j | |	 |
 | | ƒ q‡Wd  S(   Ni    i   i   R	   i   i   R   t   anchori   i   t   outlinet    t   tagst   alls   <ButtonRelease>i   t   scrollregioni–   (   R   t   colordbR&   t   _ListViewer__bboxest   unique_namest   ColorDBt   triplet_to_rrggbbt   find_bynamet   create_rectanglet   create_textt   Wt   bboxR   t   _ListViewer__onreleaset   appendt   configt   coords(   R9   RF   R>   t   rowt   widestt   bboxest   namet
   exactcolort   textidt   x1t   y1t   textendt   y2t   boxidt
   canvheightt   boxt   x2(    (    s7   /usr/lib64/python2.7/site-packages/pynche/ListViewer.pyt
   __populateD   s8    		c         C   s%  |  j  } | j | j ƒ } | j | j ƒ } | j | | | | ƒ } x% | D] } | |  j k rL PqL qL Wd  S|  j  j | ƒ } x& | D] } | d d k r† Pq† q† Wd  St j	 | ƒ \ }	 }
 } d |  _
 |  j j ƒ  rñ |  j j |	 |
 | ƒ n0 |  j |	 |
 | ƒ |	 |
 | |  _ |  _ |  _ d  S(   Ni    t   #i   (   R&   t   canvasxt   xt   canvasyt   yt   find_overlappingRG   t   gettagsRI   t   rrggbb_to_tripletR   R/   R0   R   t   update_viewst   update_yourselft   _ListViewer__redt   _ListViewer__greent   _ListViewer__blue(   R9   t   eventR>   Re   Rg   t   idsR^   RC   t   tt   redt   greent   blue(    (    s7   /usr/lib64/python2.7/site-packages/pynche/ListViewer.pyt   __onreleased   s&    		c         C   s5   |  j  j ƒ  r1 |  j j |  j |  j |  j ƒ n  d  S(   N(   R/   R0   R   Rk   Rm   Rn   Ro   (   R9   Rp   (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ListViewer.pyt   __toggleupdate   s    c         C   s   |  j  j ƒ  d  S(   N(   R   t   quit(   R9   Rp   (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ListViewer.pyt   __quitƒ   s    c         C   s   |  j  j ƒ  d  S(   N(   R   R   (   R9   Rp   (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ListViewer.pyR   †   s    c         C   s   |  j  j ƒ  d  S(   N(   R   t	   deiconify(   R9   Rp   (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ListViewer.pyRz   ‰   s    c         C   s…  |  j  } |  j r+ | j |  j d d ƒn  t j | | | f ƒ } | j | d d ƒ| |  _ |  j j d t ƒ y& |  j j	 ƒ  j
 | | | ƒ d } Wn( t j k
 rÂ |  j j t d ƒ d  SX| sß |  j j t d ƒ n$ x! | D] } |  j j t | ƒ qæ W|  j rd |  _ ni | j | ƒ \ } } } }	 | j |  j d ƒ \ } } } }
 t | d	 ƒ d
 } | j d |	 | |
 ƒ d  S(   NRA   RB   t   blacki    i   s   <no matching color>s   <no aliases>iÿÿÿÿR   g      à?t   moveto(   R&   R   t   itemconfigureRI   RJ   R8   t   deletet   ENDR   RF   t
   aliases_oft   BadColort   insertR   RS   RG   t   intR   (   R9   Rs   Rt   Ru   R>   t   colortagt   aliasesRW   t   igR[   R]   t   h(    (    s7   /usr/lib64/python2.7/site-packages/pynche/ListViewer.pyRl   Œ   s,    			&	"c         C   s   |  j  j ƒ  | d <d  S(   NR   (   R/   R0   (   R9   R   (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ListViewer.pyt   save_optionsª   s    c         C   s   |  j  j d ƒ |  j ƒ  d  S(   NRD   (   R&   R~   R-   (   R9   RF   (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ListViewer.pyt   colordb_changed­   s    N(   t   __name__t
   __module__R   R?   R-   RP   R2   R    R   Rz   Rl   Rˆ   R‰   (    (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ListViewer.pyR      s   ,	 		(    (   t   __doc__t   TkinterRI   t	   ADDTOVIEWR   (    (    (    s7   /usr/lib64/python2.7/site-packages/pynche/ListViewer.pyt   <module>   s   
