ó
    ´OÂf°  ã                   óx   • S r SSKrSSKJrJrJrJrJr   " S S\5      r " S S5      r	S r
\S	:X  a  \
" 5         gg)
zC
Tkinter widgets for displaying multi-column listboxes and tables.
é    N)ÚFrameÚLabelÚListboxÚ	ScrollbarÚTkc            
       ó¶  • \ rS rSrSr\" SSSS9r\" SSSS	S
S9r\" SSSSSSSS9rS0 4S jr	S r
S rS r\S 5       r\S 5       r\S 5       rS rS rS rS;S jr0 4S jrS r0 4S jr0 4S jrS<S  jrS! rS<S" jrS# rS$ rS% rS=S& jrS=S' jr S=S( jr!S) r"S* r#S+ r$S, r%S- r&S. r'S/ r(S0 r)S1 r*S2 r+S3 r,S4 r-S5 r.S6 r/S7 r0S8 r1S9 r2\r3\r4\r5\-r6\.r7\#r8\/r9S:r:g)>ÚMultiListboxé   a‹  
A multi-column listbox, where the current selection applies to an
entire row.  Based on the MultiListbox Tkinter widget
recipe from the Python Cookbook (https://code.activestate.com/recipes/52266/)

For the most part, ``MultiListbox`` methods delegate to its
contained listboxes.  For any methods that do not have docstrings,
see ``Tkinter.Listbox`` for a description of what that method does.
z#888Té   )Ú
backgroundÚ	takefocusÚhighlightthicknessÚraisedzhelvetica -16 boldz#444Úwhite)ÚborderwidthÚreliefÚfontr   Ú
foregroundr   FÚnone)r   Úselectborderwidthr   ÚexportselectionÚselectbackgroundÚactivestyler   Nc           	      ó  ^ • [        U[        5      (       a  [        [        U5      5      nSnOSn[	        U5      S:X  a  [        S5      e[        U5      T l        / T l        / T l	        Uc  S/[	        U5      -  nO#[	        U5      [	        U5      :w  a  [        S5      eUT l
        [        R                  " T U40 T R                  D6  T R                  SSS9  [        T R                  5       GHŠ  u  pxT R!                  XsU   S9  U(       aL  [#        T 4S	U0T R$                  D6n	T R                  R'                  U	5        U	R)                  USS
SSS9  Xyl        [-        T 40 T R.                  D6n
T R                  R'                  U
5        U
R)                  USS
SSS9  Xzl        U
R1                  ST R2                  5        U
R1                  ST R2                  5        U
R1                  SU 4S j5        U
R1                  SU 4S j5        U
R1                  SU 4S j5        U
R1                  SU 4S j5        U
R1                  SU 4S j5        U
R1                  SS 5        U
R1                  ST R4                  5        GM�     T R1                  ST R4                  5        T R1                  SU 4S j5        T R1                  SU 4S j5        T R1                  SU 4S j5        T R1                  S U 4S! j5        T R6                  " U40 UD6  g)"a  
Construct a new multi-column listbox widget.

:param master: The widget that should contain the new
    multi-column listbox.

:param columns: Specifies what columns should be included in
    the new multi-column listbox.  If ``columns`` is an integer,
    then it is the number of columns to include.  If it is
    a list, then its length indicates the number of columns
    to include; and each element of the list will be used as
    a label for the corresponding column.

:param cnf, kw: Configuration parameters for this widget.
    Use ``label_*`` to configure all labels; and ``listbox_*``
    to configure all listboxes.  E.g.:
        >>> root = Tk()  # doctest: +SKIP
        >>> MultiListbox(root, ["Subject", "Sender", "Date"], label_foreground='red').pack()  # doctest: +SKIP
FTr   zExpected at least one columnNr   z*Expected one column_weight for each column©ÚweightÚtextÚnews©ÚcolumnÚrowÚstickyÚpadxÚpadyú
<Button-1>z<B1-Motion>z
<Button-4>c                 ó&   >• TR                  S5      $ )Néÿÿÿÿ©Ú_scroll©ÚeÚselfs    €Ú1/usr/lib/python3/dist-packages/nltk/draw/table.pyÚ<lambda>Ú'MultiListbox.__init__.<locals>.<lambda>   ó   ø€ ¨D¯L©L¸Ô,<ó    z
<Button-5>c                 ó&   >• TR                  S5      $ )Nr   r(   r*   s    €r-   r.   r/   €   r0   r1   z<MouseWheel>c                 ó:   >• TR                  U R                  5      $ ©N)r)   Údeltar*   s    €r-   r.   r/   �   s   ø€ ¨d¯l©l¸1¿7¹7Ô.Cr1   z
<Button-2>c                 óP   >• TR                  U R                  U R                  5      $ r4   )Ú	scan_markÚxÚyr*   s    €r-   r.   r/   ƒ   s   ø€ ¨D¯N©N¸1¿3¹3ÀÇÁÔ,Dr1   z<B2-Motion>c                 óP   >• TR                  U R                  U R                  5      $ r4   )Úscan_dragtor8   r9   r*   s    €r-   r.   r/   „   s   ø€ ¨T×-=Ñ-=¸a¿c¹cÀ1Ç3Á3Ô-Gr1   z
<B1-Leave>c                 ó   • g)NÚbreak© )r+   s    r-   r.   r/   ‡   s   € ¨Gr1   z<Up>c                 ó"   >• TR                  SS9$ )Nr'   ©r5   ©Úselectr*   s    €r-   r.   r/   �   s   ø€  D§K¡K°b KÑ$9r1   z<Down>c                 ó"   >• TR                  SS9$ )Nr   r@   rA   r*   s    €r-   r.   r/   ‘   s   ø€  d§k¡k¸ kÑ&:r1   z<Prior>c                 ó@   >• TR                  TR                  5       * S9$ ©Nr@   ©rB   Ú	_pagesizer*   s    €r-   r.   r/   ’   s   ø€  t§{¡{¸$¿.¹.Ó:JÐ9J {Ñ'Kr1   z<Next>c                 ó>   >• TR                  TR                  5       S9$ rE   rF   r*   s    €r-   r.   r/   “   s   ø€  d§k¡k¸¿¹Ó8H kÑ&Ir1   )Ú
isinstanceÚintÚlistÚrangeÚlenÚ
ValueErrorÚtupleÚ_column_namesÚ
_listboxesÚ_labelsÚ_column_weightsr   Ú__init__ÚFRAME_CONFIGÚgrid_rowconfigureÚ	enumerateÚgrid_columnconfigurer   ÚLABEL_CONFIGÚappendÚgridÚcolumn_indexr   ÚLISTBOX_CONFIGÚbindÚ_selectÚ_resize_columnÚ	configure)r,   ÚmasterÚcolumnsÚcolumn_weightsÚcnfÚkwÚinclude_labelsÚiÚlabelÚlÚlbs   `          r-   rT   ÚMultiListbox.__init__>   s„  ø€ ô* �gœs×#Ñ#Üœ5 ›>Ó*ˆGØ"‰Nà!ˆNäˆw‹<˜1ÓÜÐ;Ó<Ð<ô # 7›^ˆÔØˆŒØˆŒð Ñ!Ø˜S¤3 w£<Ñ/‰NÜ�Ó ¤C¨£LÓ0ÜÐIÓJÐJØ-ˆÔô 	�Š�t˜VÑ9 t×'8Ñ'8Ò9Ø×Ñ˜q¨ÐÑ+Ü! $×"4Ñ"4×5‰HˆAØ×%Ñ% a¸qÑ0AÐ%ÑBö Ü˜$Ñ@ UÐ@¨d×.?Ñ.?Ñ@�Ø—‘×#Ñ# AÔ&Ø—‘˜a Q¨v¸AÀA�ÑFØ!"”ô ˜Ñ5 ×!4Ñ!4Ñ5ˆBØ�O‰O×"Ñ" 2Ô&Ø�G‰G˜1 !¨F¸ÀˆGÑCØŒOð �G‰G�L $§,¡,Ô/Ø�G‰G�M 4§<¡<Ô0à�G‰G�LÔ"<Ô=Ø�G‰G�LÔ"<Ô=Ø�G‰G�NÔ$CÔDà�G‰G�LÔ"DÔEØ�G‰G�MÔ#GÔHð �G‰G�LÑ"3Ô4à�G‰G�L $×"5Ñ"5×6ñ= 6ðD 	�	‰	�, × 3Ñ 3Ô4ð 	�	‰	�&Ô9Ô:Ø�	‰	�(Ô:Ô;Ø�	‰	�)ÔKÔLØ�	‰	�(ÔIÔJð 	�Š�sÑ!˜bÓ!r1   c                 ó"  • UR                   R                  S5      (       a  gSU l        UR                   U L ab  [        U R                  5       HH  u  p#[        UR                  UR                  5       UR                  5       -   -
  5      S:  d  MB  X l        MJ     O�UR                  UR                   R                  5       S-
  :”  a  UR                   R                  U l        OHUR                  S:  a8  UR                   R                  S:w  a  UR                   R                  S-
  U l        U R                  bZ  UR                   R                  SU R                  5        UR                   R                  S	UR                  -  U R                  5        g
g)zÌ
Callback used to resize a column of the table.  Return ``True``
if the column is actually getting resized (if the user clicked
on the far left or far right 5 pixels of a label); and
``False`` otherwies.
z<ButtonRelease>FNé
   é   r   r   ú<Motion>ú<ButtonRelease-%d>T)Úwidgetr^   Ú_resize_column_indexrW   rQ   Úabsr8   Úwinfo_xÚwinfo_widthr\   Ú_resize_column_motion_cbÚnumÚ_resize_column_buttonrelease_cb)r,   Úeventrh   rk   s       r-   r`   ÚMultiListbox._resize_columnœ   s1  € ð �<‰<×ÑÐ.×/Ñ/Øð %)ˆÔ!Ø�<‰<˜4ÒÜ" 4§?¡?Ö3‘�Ü�u—w‘w "§*¡*£,°·±Ó1AÑ"AÑBÓCÀbÕHØ01Ö-ò 4ð �W‰W˜Ÿ™×0Ñ0Ó2°QÑ6Ó7Ø(-¯©×(AÑ(AˆDÕ%Ø�W‰W�q‹[˜UŸ\™\×6Ñ6¸!Ó;Ø(-¯©×(AÑ(AÀAÑ(EˆDÔ%ð ×$Ñ$Ñ0Ø�L‰L×Ñ˜j¨$×*GÑ*GÔHØ�L‰L×ÑØ$ u§y¡yÑ0°$×2VÑ2Vôð àr1   c                 ó8  • U R                   U R                     nUR                  5       US   -  nUR                  UR                  R                  5       -   nUR                  5       UR                  5       -   n[        S[        US   XE-
  U-  -   5      5      US'   g )NÚwidthé   )rQ   rs   rv   r8   rr   ru   ÚmaxrJ   )r,   rz   rk   Ú	charwidthÚx1Úx2s         r-   rw   Ú%MultiListbox._resize_column_motion_cb½   s‚   € Ø�_‰_˜T×6Ñ6Ñ7ˆØ—N‘NÓ$ r¨'¡{Ñ2ˆ	à�W‰W�u—|‘|×+Ñ+Ó-Ñ-ˆØ�Z‰Z‹\˜BŸN™NÓ,Ñ,ˆä˜!œS  G¡°±¸IÑ/EÑ!EÓFÓGˆˆ7Šr1   c                 óŠ   • UR                   R                  SUR                  -  5        UR                   R                  S5        g )Nrq   rp   )rr   Úunbindrx   )r,   rz   s     r-   ry   Ú,MultiListbox._resize_column_buttonrelease_cbÆ   s0   € Ø�‰×ÑÐ0°5·9±9Ñ<Ô=Ø�‰×Ñ˜JÕ'r1   c                 ó   • U R                   $ )zP
A tuple containing the names of the columns used by this
multi-column listbox.
)rP   ©r,   s    r-   Úcolumn_namesÚMultiListbox.column_namesÎ   s   € ð ×!Ñ!Ð!r1   c                 ó,   • [        U R                  5      $ )a‰  
A tuple containing the ``Tkinter.Label`` widgets used to
display the label of each column.  If this multi-column
listbox was created without labels, then this will be an empty
tuple.  These widgets will all be augmented with a
``column_index`` attribute, which can be used to determine
which column they correspond to.  This can be convenient,
e.g., when defining callbacks for bound events.
)rO   rR   rˆ   s    r-   Úcolumn_labelsÚMultiListbox.column_labelsÖ   s   € ô �T—\‘\Ó"Ð"r1   c                 ó,   • [        U R                  5      $ )a)  
A tuple containing the ``Tkinter.Listbox`` widgets used to
display individual columns.  These widgets will all be
augmented with a ``column_index`` attribute, which can be used
to determine which column they correspond to.  This can be
convenient, e.g., when defining callbacks for bound events.
)rO   rQ   rˆ   s    r-   Ú	listboxesÚMultiListbox.listboxesã   s   € ô �T—_‘_Ó%Ð%r1   c                 óÖ   • UR                   R                  UR                  5      nU R                  SS5        U R	                  U5        U R                  U5        U R                  5         g )Nr   Úend)rr   Únearestr9   Úselection_clearÚselection_setÚactivateÚfocus)r,   r+   rh   s      r-   r_   ÚMultiListbox._selectò   sM   € Ø�H‰H×Ñ˜QŸS™SÓ!ˆØ×Ñ˜Q Ô&Ø×Ñ˜1ÔØ�‰�aÔØ�
‰
�r1   c                 óN   • U R                    H  nUR                  US5        M     g)NÚunitr=   ©rQ   Úyview_scroll)r,   r5   rk   s      r-   r)   ÚMultiListbox._scrollù   s!   € Ø—/”/ˆBØ�O‰O˜E 6Ö*ñ "àr1   c                 ól   • [        U R                  S5      5      [        U R                  S5      5      -
  $ )z2:return: The number of rows that makes up one pagez
@0,1000000z@0,0)rJ   Úindexrˆ   s    r-   rG   ÚMultiListbox._pagesizeþ   s)   € ä�4—:‘:˜lÓ+Ó,¬s°4·:±:¸fÓ3EÓ/FÑFÐFr1   c                 ó~  • Ub  Ub  [        S5      eUbB  [        U R                  5       5      S:X  a  SU-   nO[        U R                  5       S   5      U-   nU R	                  SS5        UbR  [        [        US5      U R                  5       S-
  5      nU R                  U5        U(       a  U R                  U5        ggg)a’  
Set the selected row.  If ``index`` is specified, then select
row ``index``.  Otherwise, if ``delta`` is specified, then move
the current selection by ``delta`` (negative numbers for up,
positive numbers for down).  This will not move the selection
past the top or the bottom of the list.

:param see: If true, then call ``self.see()`` with the newly
    selected index, to ensure that it is visible.
Nz$specify index or delta, but not bothr   r'   r’   r   )
rN   rM   ÚcurselectionrJ   r”   Úminr   Úsizer•   Úsee©r,   rŸ   r5   r¥   s       r-   rB   ÚMultiListbox.select  s»   € ð Ñ EÑ$5ÜÐCÓDÐDð ÑÜ�4×$Ñ$Ó&Ó'¨1Ó,Ø˜U™
‘ä˜D×-Ñ-Ó/°Ñ2Ó3°eÑ;�ð 	×Ñ˜Q Ô&ð ÑÜœ˜E 1› t§y¡y£{°Q¡Ó7ˆEà×Ñ˜uÔ%ÞØ—‘˜•ð ð	 r1   c                 óL  • [        [        UR                  5       5      [        UR                  5       5      -   5      n[        UR                  5       5       HË  u  p4UR                  S5      (       d  UR                  S5      (       a+  U R                   H  nUR                  USS U05        M     M\  UR                  S5      (       d  UR                  S5      (       a+  U R                   H  nUR                  USS U05        M     M³  [        R
                  " XU05        MÍ     g)aj  
Configure this widget.  Use ``label_*`` to configure all
labels; and ``listbox_*`` to configure all listboxes.  E.g.:

        >>> master = Tk()  # doctest: +SKIP
        >>> mlb = MultiListbox(master, 5)  # doctest: +SKIP
        >>> mlb.configure(label_foreground='red')  # doctest: +SKIP
        >>> mlb.configure(listbox_foreground='red')  # doctest: +SKIP
Úlabel_zlabel-é   NÚlistbox_zlistbox-é   )ÚdictrK   ÚitemsÚ
startswithrR   ra   rQ   r   )r,   re   rf   ÚkeyÚvalri   Úlistboxs          r-   ra   ÚMultiListbox.configure*  sÖ   € ô ”4˜Ÿ	™	›Ó$¤t¨B¯H©H«JÓ'7Ñ7Ó8ˆÜ˜SŸY™Y›[Ö)‰HˆCØ�~‰~˜h×'Ñ'¨3¯>©>¸(×+CÑ+CØ!Ÿ\œ\�EØ—O‘O S¨¨ W¨c NÖ3ó *à—‘ 
×+Ñ+¨s¯~©~¸j×/IÑ/IØ#Ÿœ�GØ×%Ñ% s¨1¨2 w° nÖ5ó  /ô —’ ¨C jÖ1ò *r1   c                 ó(   • U R                  X05        g)zd
Configure this widget.  This is equivalent to
``self.configure({key,val``)}.  See ``configure()``.
N)ra   )r,   r°   r±   s      r-   Ú__setitem__ÚMultiListbox.__setitem__?  s   € ð
 	�‰˜�zÕ"r1   c                 óP   • U R                    H  nUR                  " X40 UD6  M     g)z§
Configure all table cells in the given row.  Valid keyword
arguments are: ``background``, ``bg``, ``foreground``, ``fg``,
``selectbackground``, ``selectforeground``.
N©rQ   Úitemconfigure)r,   Ú	row_indexre   rf   rk   s        r-   ÚrowconfigureÚMultiListbox.rowconfigureF  s%   € ð —/”/ˆBØ×Ò˜YÑ2¨rÔ2ò "r1   c                 óx  • U R                   U   n[        [        UR                  5       5      [        UR                  5       5      -   5      n[        UR                  5       5       HR  u  pVUS;   a5  [	        UR                  5       5       H  nUR                  XuU05        M     M@  UR                  XV05        MT     g)zª
Configure all table cells in the given column.  Valid keyword
arguments are: ``background``, ``bg``, ``foreground``, ``fg``,
``selectbackground``, ``selectforeground``.
)r   Úbgr   Úfgr   ÚselectforegroundN)rQ   r­   rK   r®   rL   r¤   r¹   ra   )r,   Ú	col_indexre   rf   rk   r°   r±   rh   s           r-   ÚcolumnconfigureÚMultiListbox.columnconfigureO  s”   € ð �_‰_˜YÑ'ˆä”4˜Ÿ	™	›Ó$¤t¨B¯H©H«JÓ'7Ñ7Ó8ˆÜ˜SŸY™Y›[Ö)‰HˆCØð ó ô ˜rŸw™w›yÖ)�AØ×$Ñ$ Q¨c¨
Ö3ó *ð —‘˜c˜ZÖ(ò *r1   c                 óF   • U R                   U   nUR                  " X40 UD6$ )z±
Configure the table cell at the given row and column.  Valid
keyword arguments are: ``background``, ``bg``, ``foreground``,
``fg``, ``selectbackground``, ``selectforeground``.
r¸   )r,   rº   rÁ   re   rf   rk   s         r-   r¹   ÚMultiListbox.itemconfiguref  s(   € ð �_‰_˜YÑ'ˆØ×Ò 	Ñ5°"Ñ5Ð5r1   c                 óò   • U H0  n[        U5      [        U R                  5      :w  d  M'  [        S5      e   [        U R                  [        [        U6 5      5       H  u  pEUR                  " U/UQ76   M     g)a   
Insert the given row or rows into the table, at the given
index.  Each row value should be a tuple of cell values, one
for each column in the row.  Index may be an integer or any of
the special strings (such as ``'end'``) accepted by
``Tkinter.Listbox``.
zDrows should be tuples whose length is equal to the number of columnsN)rM   rP   rN   ÚziprQ   rK   Úinsert)r,   rŸ   ÚrowsÚeltrk   Úeltss         r-   rÈ   ÚMultiListbox.inserts  sj   € ó ˆCÜ�3‹xœ3˜t×1Ñ1Ó2Õ2Ü ð8óð ñ ô ˜DŸO™O¬T´#°t°*Ó-=Ö>‰HˆBØ�IŠI�eÐ#˜dÕ#ò ?r1   c                 óÒ   • U R                    Vs/ s H  o3R                  X5      PM     nnU(       a"  [        U6  Vs/ s H  n[        U5      PM     sn$ [        U5      $ s  snf s  snf )zà
Return the value(s) of the specified row(s).  If ``last`` is
not specified, then return a single row value; otherwise,
return a list of row values.  Each row value is a tuple of
cell values, one for each column in the row.
)rQ   ÚgetrÇ   rO   )r,   ÚfirstÚlastrk   Úvaluesr!   s         r-   rÎ   ÚMultiListbox.get„  sV   € ð 15·²Ó@²¨"—&‘&˜Ö%±ˆÐ@ÞÜ*-¨v©,Ó7ª, 3”E˜#–J©,Ñ7Ð7ä˜“=Ð ùò	 Aùâ7s
   �A¼A$c                 óð   • U R                  SUS9u  p4  nU R                  U   R                  U5      u  pgp‰[        U5      [        U5      -   [        U5      [        U5      -   [        U5      [        U	5      4$ )z§
Return the bounding box for the given table cell, relative to
this widget's top-left corner.  The bounding box is a tuple
of integers ``(left, top, width, height)``.
r   )r!   r    )Ú	grid_bboxrQ   ÚbboxrJ   )
r,   r!   ÚcolÚdxÚdyÚ_r8   r9   ÚwÚhs
             r-   rÕ   ÚMultiListbox.bbox‘  sj   € ð —~‘~¨!°C�~Ð8‰ˆ��1Ø—_‘_ SÑ)×.Ñ.¨sÓ3‰
ˆˆaÜ�1‹vœ˜B›Ñ¤ Q£¬#¨b«'Ñ!1´3°q³6¼3¸q»6ÐAÐAr1   c                 óº   • U R                   (       a  U R                   U   R                  5         U R                  U   R                  5         U R                  USS9  g)a  
Hide the given column.  The column's state is still
maintained: its values will still be returned by ``get()``, and
you must supply its values when calling ``insert()``.  It is
safe to call this on a column that is already hidden.

:see: ``show_column()``
r   r   N)rR   Úgrid_forgetr�   rX   )r,   rÁ   s     r-   Úhide_columnÚMultiListbox.hide_columnŸ  sH   € ð �<�<Ø�L‰L˜Ñ#×/Ñ/Ô1Ø�‰�yÑ!×-Ñ-Ô/Ø×!Ñ! )°AÐ!Ò6r1   c                 óâ   • U R                   U   nU R                  (       a   U R                  U   R                  USSSSS9  U R                  U   R                  USSSSS9  U R	                  XS9  g)zx
Display a column that has been hidden using ``hide_column()``.
It is safe to call this on a column that is not hidden.
r   r   r   r   r   N)rS   rR   r[   rQ   rX   )r,   rÁ   r   s      r-   Úshow_columnÚMultiListbox.show_column­  s~   € ð
 ×%Ñ% iÑ0ˆØ�<�<Ø�L‰L˜Ñ#×(Ñ(Ø  a°¸QÀQð )ñ ð 	�‰˜	Ñ"×'Ñ'Ø !¨F¸Àð 	(ñ 	
ð 	×!Ñ! )Ð!Ò;r1   c                 ód   • U R                    Vs/ s H  oDR                  XU5      PM     sn$ s  snf )a  
Add a binding to each ``Tkinter.Label`` widget in this
mult-column listbox that will call ``func`` in response to the
event sequence.

:return: A list of the identifiers of replaced binding
    functions (if any), allowing for their deletion (to
    prevent a memory leak).
)rŒ   r^   )r,   ÚsequenceÚfuncÚaddri   s        r-   Úbind_to_labelsÚMultiListbox.bind_to_labelsÀ  s.   € ð >B×=OÒ=OÓPÒ=O°E—
‘
˜8¨3Ö/Ñ=OÑPÐPùÒPs   �-c                 óN   • U R                    H  nUR                  XU5        M     g)a  
Add a binding to each ``Tkinter.Listbox`` widget in this
mult-column listbox that will call ``func`` in response to the
event sequence.

:return: A list of the identifiers of replaced binding
    functions (if any), allowing for their deletion (to
    prevent a memory leak).
N)r�   r^   )r,   rå   ræ   rç   r²   s        r-   Úbind_to_listboxesÚMultiListbox.bind_to_listboxesÌ  s    € ð —~”~ˆGØ�L‰L˜¨Ö-ò &r1   c                 óL   • U R                  XU5      U R                  XU5      -   $ )a+  
Add a binding to each ``Tkinter.Label`` and ``Tkinter.Listbox``
widget in this mult-column listbox that will call ``func`` in
response to the event sequence.

:return: A list of the identifiers of replaced binding
    functions (if any), allowing for their deletion (to
    prevent a memory leak).
)rè   rë   ©r,   rå   ræ   rç   s       r-   Úbind_to_columnsÚMultiListbox.bind_to_columnsÙ  s0   € ð ×"Ñ" 8°3Ó7¸$×:PÑ:PØ˜Có;
ñ 
ð 	
r1   c                 ó@   • U R                   S   R                  " U0 UD6$ ©Nr   )rQ   r¢   ©r,   ÚargsÚkwargss      r-   r¢   ÚMultiListbox.curselectionì  s!   € Ø�‰˜qÑ!×.Ò.°Ð?¸Ñ?Ð?r1   c                 ó@   • U R                   S   R                  " U0 UD6$ rò   )rQ   Úselection_includesró   s      r-   rø   ÚMultiListbox.selection_includesï  s!   € Ø�‰˜qÑ!×4Ò4°dÐE¸fÑEÐEr1   c                 ó@   • U R                   S   R                  " U0 UD6$ rò   )rQ   Úitemcgetró   s      r-   rû   ÚMultiListbox.itemcgetò  s!   € Ø�‰˜qÑ!×*Ò*¨DÐ;°FÑ;Ð;r1   c                 ó@   • U R                   S   R                  " U0 UD6$ rò   )rQ   r¤   ró   s      r-   r¤   ÚMultiListbox.sizeõ  s!   € Ø�‰˜qÑ!×&Ò&¨Ð7°Ñ7Ð7r1   c                 ó@   • U R                   S   R                  " U0 UD6$ rò   )rQ   rŸ   ró   s      r-   rŸ   ÚMultiListbox.indexø  s!   € Ø�‰˜qÑ!×'Ò'¨Ð8°Ñ8Ð8r1   c                 ó@   • U R                   S   R                  " U0 UD6$ rò   )rQ   r“   ró   s      r-   r“   ÚMultiListbox.nearestû  s!   € Ø�‰˜qÑ!×)Ò)¨4Ð:°6Ñ:Ð:r1   c                 óN   • U R                    H  nUR                  " U0 UD6  M     g r4   )rQ   r–   ©r,   rô   rõ   rk   s       r-   r–   ÚMultiListbox.activateÿ  s!   € Ø—/”/ˆBØ�KŠK˜Ð( Ô(ò "r1   c                 óN   • U R                    H  nUR                  " U0 UD6  M     g r4   )rQ   Údeleter  s       r-   r  ÚMultiListbox.delete  s!   € Ø—/”/ˆBØ�IŠI�tÐ&˜vÔ&ò "r1   c                 óN   • U R                    H  nUR                  " U0 UD6  M     g r4   )rQ   r7   r  s       r-   r7   ÚMultiListbox.scan_mark  s!   € Ø—/”/ˆBØ�LŠL˜$Ð) &Ô)ò "r1   c                 óN   • U R                    H  nUR                  " U0 UD6  M     g r4   )rQ   r;   r  s       r-   r;   ÚMultiListbox.scan_dragto  s!   € Ø—/”/ˆBØ�NŠN˜DÐ+ FÔ+ò "r1   c                 óN   • U R                    H  nUR                  " U0 UD6  M     g r4   )rQ   r¥   r  s       r-   r¥   ÚMultiListbox.see  s!   € Ø—/”/ˆBØ�FŠF�DÐ#˜FÔ#ò "r1   c                 óN   • U R                    H  nUR                  " U0 UD6  M     g r4   )rQ   Úselection_anchorr  s       r-   r  ÚMultiListbox.selection_anchor  s#   € Ø—/”/ˆBØ×Ò Ð0¨Ô0ò "r1   c                 óN   • U R                    H  nUR                  " U0 UD6  M     g r4   )rQ   r”   r  s       r-   r”   ÚMultiListbox.selection_clear  s#   € Ø—/”/ˆBØ×Ò Ð/¨Ô/ò "r1   c                 óN   • U R                    H  nUR                  " U0 UD6  M     g r4   )rQ   r•   r  s       r-   r•   ÚMultiListbox.selection_set  s#   € Ø—/”/ˆBØ×Ò˜dÐ- fÔ-ò "r1   c                 óP   • U R                    H  nUR                  " U0 UD6nM     W$ r4   )rQ   Úyview)r,   rô   rõ   rk   Úvs        r-   r  ÚMultiListbox.yview  s(   € Ø—/”/ˆBØ—’˜$Ð) &Ñ)ŠAñ "àˆr1   c                 óN   • U R                    H  nUR                  " U0 UD6  M     g r4   )rQ   Úyview_movetor  s       r-   r  ÚMultiListbox.yview_moveto$  ó!   € Ø—/”/ˆBØ�OŠO˜TÐ, VÔ,ò "r1   c                 óN   • U R                    H  nUR                  " U0 UD6  M     g r4   r›   r  s       r-   rœ   ÚMultiListbox.yview_scroll(  r  r1   )rP   rS   rR   rQ   rs   ©NNTr4   ©NNN);Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r­   rU   rY   r]   rT   r`   rw   ry   Úpropertyr‰   rŒ   r�   r_   r)   rG   rB   ra   rµ   r»   rÂ   r¹   rÈ   rÎ   rÕ   rß   râ   rè   rë   rï   r¢   rø   rû   r¤   rŸ   r“   r–   r  r7   r;   r¥   r  r”   r•   r  r  rœ   Ú
itemconfigÚ	rowconfigÚcolumnconfigÚselect_anchorÚselect_clearÚselect_includesÚ
select_setÚ__static_attributes__r>   r1   r-   r	   r	      s’  † ññ  6°TÈaÑP€Lñ ØØØ!ØØñ€Lñ ØØØØØØØñ€Nð 8<Àô X"ò|òBHò(ð ñ"ó ð"ð ñ
#ó ð
#ð ñ&ó ð&òòò
Gô ðH ô 2ò*#ð +-ô 3ð .0ô )ô.6ò$ô"!òBò7ò<ô&
Qô.ô
ò&@òFò<ò8ò9ò;ò)ò'ò*ò,ò$ò1ò0ò.òò
-ò-ð €JØ€IØ"€LØ$€MØ"€LØ(€OØƒJr1   r	   c                   ó>  • \ rS rSrSrSSSSS0 4S jrS rS rS rS(S	 jr	0 4S
 jr
0 4S jrS)S jrS(S jrS(S jrS(S jr\
r\r\rS rS rS rS rS rS rS rS rS r\S 5       rS rS rS r S r!S*S jr"S+S jr#S  r$S,S! jr%S" r&S-S$ jr'S.S% jr(S#r) S& r*S'r+g)/ÚTableiE  ax  
A display widget for a table of values, based on a ``MultiListbox``
widget.  For many purposes, ``Table`` can be treated as a
list-of-lists.  E.g., table[i] is a list of the values for row i;
and table.append(row) adds a new row with the given list of
values.  Individual cells can be accessed using table[i,j], which
refers to the j-th column of the i-th row.  This can be used to
both read and write values from the table.  E.g.:

    >>> table[i,j] = 'hello'  # doctest: +SKIP

The column (j) can be given either as an index number, or as a
column name.  E.g., the following prints the value in the 3rd row
for the 'First Name' column:

    >>> print(table[3, 'First Name'])  # doctest: +SKIP
    John

You can configure the colors for individual rows, columns, or
cells using ``rowconfig()``, ``columnconfig()``, and ``itemconfig()``.
The color configuration for each row will be preserved if the
table is modified; however, when new rows are added, any color
configurations that have been made for *columns* will not be
applied to the new row.

Note: Although ``Table`` acts like a widget in some ways (e.g., it
defines ``grid()``, ``pack()``, and ``bind()``), it is not itself a
widget; it just contains one.  This is because widgets need to
define ``__getitem__()``, ``__setitem__()``, and ``__nonzero__()`` in
a way that's incompatible with the fact that ``Table`` behaves as a
list-of-lists.

:ivar _mlb: The multi-column listbox used to display this table's data.
:ivar _rows: A list-of-lists used to hold the cell values of this
    table.  Each element of _rows is a row value, i.e., a list of
    cell values, one for each column in the row.
NTc	                 óx  • [        U5      U l        Xpl        [        U5      U l        [        U5       V
Vs0 s H  u  p«Xº_M	     snn
U l        Uc  / U l        O)U VVs/ s H  oÌ Vs/ s H  oÝPM     snPM     snnU l        U R                   H  nU R                  U5        M     [        U R                  X$U40 U	D6U l
        U R                  R                  SSSS9  U(       ae  [        U R                  SU R                  R                  S9nUR                  U R                  R                  S   S	'   UR                  S
SS9  Xàl        SU l        U(       aD  [        U R                  R$                  5       H!  u  p¯UR'                  SU R(                  5        M#     U R+                  5         gs  snn
f s  snf s  snnf )aþ  
Construct a new Table widget.

:type master: Tkinter.Widget
:param master: The widget that should contain the new table.
:type column_names: list(str)
:param column_names: A list of names for the columns; these
    names will be used to create labels for each column;
    and can be used as an index when reading or writing
    cell values from the table.
:type rows: list(list)
:param rows: A list of row values used to initialize the table.
    Each row value should be a tuple of cell values, one for
    each column in the row.
:type scrollbar: bool
:param scrollbar: If true, then create a scrollbar for the
    new table widget.
:type click_to_sort: bool
:param click_to_sort: If true, then create bindings that will
    sort the table's rows by a given column's values if the
    user clicks on that colum's label.
:type reprfunc: function
:param reprfunc: If specified, then use this function to
    convert each table cell value to a string suitable for
    display.  ``reprfunc`` has the following signature:
    reprfunc(row_index, col_index, cell_value) -> str
    (Note that the column is specified by index, not by name.)
:param cnf, kw: Configuration parameters for this widget's
    contained ``MultiListbox``.  See ``MultiListbox.__init__()``
    for details.
NÚleftTÚboth)ÚsideÚexpandÚfillÚvertical)ÚorientÚcommandr   ÚyscrollcommandÚrightr9   )r5  r7  r%   )rM   Ú_num_columnsÚ	_reprfuncr   Ú_framerW   Ú_column_name_to_indexÚ_rowsÚ	_checkrowr	   Ú_mlbÚpackr   r  Úsetr�   Ú
_scrollbarÚ_sortkeyrŒ   r^   Ú_sortÚ_fill_table)r,   rb   r‰   rÉ   rd   Ú	scrollbarÚclick_to_sortÚreprfuncre   rf   rh   Úcr!   r  Úsbrj   s                   r-   rT   ÚTable.__init__l  sl  € ôV   Ó-ˆÔØ!ŒÜ˜F“mˆŒä9BÀ<Ô9PÔ%QÒ9P©v° a¢dÑ9PÒ%QˆÔ"ð ‰<ØˆD�Já6:Ô;²d¨s cÓ*¢c š1¡cÔ*±dÒ;ˆDŒJØ—:”:ˆCØ�N‰N˜3Öñ ô ! §¡¨lÈCÑVÐSUÑVˆŒ	Ø�	‰	�‰˜F¨4°fˆÑ=ö Ü˜4Ÿ;™;¨zÀ4Ç9Á9Ç?Á?ÑSˆBØ79·v±vˆD�I‰I×Ñ Ñ"Ð#3Ñ4ð �G‰G˜ sˆGÑ+Ø ŒOð ˆŒÞÜ! $§)¡)×"9Ñ"9Ö:‘�Ø—‘�| T§Z¡ZÖ0ñ ;ð 	×ÑÕùó= &Rùò +ùÓ;s   µF+Á	F6Á%F1Á0F6Æ1F6c                 ó<   • U R                   R                  " U0 UD6  g)zjPosition this table's main frame widget in its parent
widget.  See ``Tkinter.Frame.pack()`` for more info.N)r?  rD  ró   s      r-   rD  Ú
Table.packÀ  ó   € ð 	�‰×Ò˜$Ð) &Ó)r1   c                 ó<   • U R                   R                  " U0 UD6  g)zjPosition this table's main frame widget in its parent
widget.  See ``Tkinter.Frame.grid()`` for more info.N)r?  r[   ró   s      r-   r[   Ú
Table.gridÅ  rR  r1   c                 ó8   • U R                   R                  5         g)z-Direct (keyboard) input foxus to this widget.N)rC  r—   rˆ   s    r-   r—   ÚTable.focusÊ  s   € à�	‰	�‰Õr1   c                 ó<   • U R                   R                  XU5        g)zcAdd a binding to this table's main frame that will call
``func`` in response to the event sequence.N)rC  r^   rî   s       r-   r^   Ú
Table.bindÎ  s   € ð 	�	‰	�‰�x sÕ+r1   c                 ó>   • U R                   R                  " X40 UD6  g)z%:see: ``MultiListbox.rowconfigure()``N)rC  r»   )r,   rº   re   rf   s       r-   r»   ÚTable.rowconfigureÓ  s   € à�	‰	×Ò˜yÑ4°Ó4r1   c                 ó`   • U R                  U5      nU R                  R                  " X40 UD6  g)z(:see: ``MultiListbox.columnconfigure()``N)r\   rC  rÂ   )r,   rÁ   re   rf   s       r-   rÂ   ÚTable.columnconfigure×  s)   € à×%Ñ% iÓ0ˆ	Ø�	‰	×!Ò! )Ñ7°BÓ7r1   c                 ó`   • U R                  U5      nU R                  R                  " XU40 UD6$ )z&:see: ``MultiListbox.itemconfigure()``)r\   rC  r¹   )r,   rº   rÁ   re   rf   s        r-   r¹   ÚTable.itemconfigureÜ  s.   € à×%Ñ% iÓ0ˆ	Ø�y‰y×&Ò& y¸SÑGÀBÑGÐGr1   c                 ó:   • U R                   R                  XU5      $ )z':see: ``MultiListbox.bind_to_labels()``)rC  rè   rî   s       r-   rè   ÚTable.bind_to_labelsá  s   € à�y‰y×'Ñ'¨¸Ó<Ð<r1   c                 ó:   • U R                   R                  XU5      $ )z*:see: ``MultiListbox.bind_to_listboxes()``)rC  rë   rî   s       r-   rë   ÚTable.bind_to_listboxeså  s   € à�y‰y×*Ñ*¨8¸3Ó?Ð?r1   c                 ó:   • U R                   R                  XU5      $ )z(:see: ``MultiListbox.bind_to_columns()``)rC  rï   rî   s       r-   rï   ÚTable.bind_to_columnsé  s   € à�y‰y×(Ñ(¨¸Ó=Ð=r1   c           	      óZ  • U R                  U5        U R                  R                  X5        U R                  b/  [	        U5       VVs/ s H  u  p4U R                  XU5      PM     nnnU R
                  R                  X5        U R                  (       a  U R                  5         ggs  snnf )a  
Insert a new row into the table, so that its row index will be
``row_index``.  If the table contains any rows whose row index
is greater than or equal to ``row_index``, then they will be
shifted down.

:param rowvalue: A tuple of cell values, one for each column
    in the new row.
N)rB  rA  rÈ   r>  rW   rC  Ú_DEBUGÚ_check_table_vs_mlb)r,   rº   ÚrowvalueÚjr  s        r-   rÈ   ÚTable.insertõ  sŒ   € ð 	�‰�xÔ Ø�
‰
×Ñ˜)Ô.Ø�>‰>Ñ%ä>GÈÔ>QôÚ>Q±F°Q�—‘˜y¨QÖ/Ñ>Qð ñ ð 	�	‰	×Ñ˜Ô-Ø�;�;Ø×$Ñ$Õ&ð ùó	s   ÁB'c                 ó|   • U H  nU R                  U5        M     U R                  (       a  U R                  5         gg)zÇ
Add new rows at the end of the table.

:param rowvalues: A list of row values used to initialize the
    table.  Each row value should be a tuple of cell values,
    one for each column in the row.
N)rZ   rf  rg  )r,   Ú	rowvaluesrh  s      r-   ÚextendÚTable.extend	  s2   € ó "ˆHØ�K‰K˜Ö!ñ "à�;�;Ø×$Ñ$Õ&ð r1   c                 ó’   • U R                  [        U R                  5      U5        U R                  (       a  U R	                  5         gg)zz
Add a new row to the end of the table.

:param rowvalue: A tuple of cell values, one for each column
    in the new row.
N)rÈ   rM   rA  rf  rg  ©r,   rh  s     r-   rZ   ÚTable.append  s2   € ð 	�‰”C˜Ÿ
™
“O XÔ.Ø�;�;Ø×$Ñ$Õ&ð r1   c                 óŽ   • / U l         U R                  R                  SS5        U R                  (       a  U R	                  5         gg)z 
Delete all rows in this table.
r   r’   N)rA  rC  r  rf  rg  rˆ   s    r-   ÚclearÚTable.clear!  s7   € ð ˆŒ
Ø�	‰	×Ñ˜˜EÔ"Ø�;�;Ø×$Ñ$Õ&ð r1   c                 ó  • [        U[        5      (       a  [        S5      e[        U[        5      (       a6  [	        U5      S:X  a'  U R
                  US      U R                  US   5         $ [        U R
                  U   5      $ )aS  
Return the value of a row or a cell in this table.  If
``index`` is an integer, then the row value for the ``index``th
row.  This row value consists of a tuple of cell values, one
for each column in the row.  If ``index`` is a tuple of two
integers, ``(i,j)``, then return the value of the cell in the
``i``th row and the ``j``th column.
úSlicing not supportedé   r   r   )rI   ÚslicerN   rO   rM   rA  r\   )r,   rŸ   s     r-   Ú__getitem__ÚTable.__getitem__*  so   € ô �eœU×#Ñ#ÜÐ4Ó5Ð5Ü˜œu×%Ñ%¬#¨e«*¸«/Ø—:‘:˜e A™hÑ'¨×(9Ñ(9¸%À¹(Ó(CÑDÐDä˜Ÿ™ EÑ*Ó+Ð+r1   c           	      ó˜  • [        U[        5      (       a  [        S5      e[        U[        5      (       aÎ  [	        U5      S:X  a¿  US   U R                  US   5      pCU R                  U/5      nX R                  U   U'   U R                  b  U R                  X4U5      nU R                  R                  U   R                  X25        U R                  R                  U   R                  US-   5        U R                  U5        gU R                  U/5      nU R                  U5        [        U5      U R                  U'   U R                  b/  [!        U5       VVs/ s H  u  pFU R                  XU5      PM     nnnU R                  R                  X5        U R                  R                  US-   5        U R                  U5        gs  snnf )aª  
Replace the value of a row or a cell in this table with
``val``.

If ``index`` is an integer, then ``val`` should be a row value
(i.e., a tuple of cell values, one for each column).  In this
case, the values of the ``index``th row of the table will be
replaced with the values in ``val``.

If ``index`` is a tuple of integers, ``(i,j)``, then replace the
value of the cell in the ``i``th row and ``j``th column with
``val``.
rv  rw  r   r   N)rI   rx  rN   rO   rM   r\   Ú_save_config_inforA  r>  rC  r�   rÈ   r  Ú_restore_config_inforB  rK   rW   )r,   rŸ   r±   rh   ri  Úconfig_cookier  s          r-   rµ   ÚTable.__setitem__:  su  € ô �eœU×#Ñ#ÜÐ4Ó5Ð5ô ˜œu×%Ñ%¬#¨e«*¸«/Ø˜‘8˜T×.Ñ.¨u°Q©xÓ8ˆqØ ×2Ñ2°A°3Ó7ˆMØ"�J‰J�q‰M˜!ÑØ�~‰~Ñ)Ø—n‘n Q¨3Ó/�Ø�I‰I×Ñ Ñ"×)Ñ)¨!Ô1Ø�I‰I×Ñ Ñ"×)Ñ)¨!¨a©%Ô0Ø×%Ñ% mÕ4ð !×2Ñ2°E°7Ó;ˆMØ�N‰N˜3ÔÜ $ S£	ˆD�J‰J�uÑØ�~‰~Ñ)ÜAJÈ3ÄÔPÂ±v¸�t—~‘~ e°Ö2Á�ÑPØ�I‰I×Ñ˜UÔ(Ø�I‰I×Ñ˜U Q™YÔ'Ø×%Ñ% mÕ4ùó Qs   ÅGc                 ó6  • [        U[        5      (       a  [        S5      e[        U[        5      (       a  [	        U5      S:X  a  [        S5      eU R
                  U	 U R                  R                  U5        U R                  (       a  U R                  5         gg)z1
Delete the ``row_index``th row from this table.
rv  rw  zCannot delete a single cell!N)
rI   rx  rN   rO   rM   rA  rC  r  rf  rg  )r,   rº   s     r-   Ú__delitem__ÚTable.__delitem__a  sw   € ô �i¤×'Ñ'ÜÐ4Ó5Ð5Ü�i¤×'Ñ'¬C°	«N¸aÓ,?ÜÐ;Ó<Ð<Ø�J‰J�yÐ!Ø�	‰	×Ñ˜Ô#Ø�;�;Ø×$Ñ$Õ&ð r1   c                 ó,   • [        U R                  5      $ )z,
:return: the number of rows in this table.
)rM   rA  rˆ   s    r-   Ú__len__ÚTable.__len__n  s   € ô �4—:‘:‹Ðr1   c                 ó~   • [        U5      U R                  :w  a$  [        SU[        U5      U R                  4-  5      eg)zs
Helper function: check that a given row value has the correct
number of elements; and if not, raise an exception.
z"Row %r has %d columns; expected %dN)rM   r=  rN   rp  s     r-   rB  ÚTable._checkrowt  sD   € ô
 ˆx‹=˜D×-Ñ-Ó-ÜØ4ØœS ›]¨D×,=Ñ,=Ð>ñ?óð ð .r1   c                 ó.   • U R                   R                  $ )z1A list of the names of the columns in this table.)rC  r‰   rˆ   s    r-   r‰   ÚTable.column_namesƒ  s   € ð �y‰y×%Ñ%Ð%r1   c                 ó€   • [        U[        5      (       a  SUs=::  a  U R                  :  a   U$   U R                  U   $ )zÎ
If ``i`` is a valid column index integer, then return it as is.
Otherwise, check if ``i`` is used as the name for any column;
if so, return that column's index.  Otherwise, raise a
``KeyError`` exception.
r   )rI   rJ   r=  r@  )r,   rh   s     r-   r\   ÚTable.column_indexˆ  s@   € ô �aœ×Ñ ! qÕ"<¨4×+<Ñ+<Ô"<ØˆHð #=ð ×-Ñ-¨aÑ0Ð0r1   c                 óX   • U R                   R                  U R                  U5      5        g)z$:see: ``MultiListbox.hide_column()``N)rC  rß   r\   ©r,   r\   s     r-   rß   ÚTable.hide_column•  ó   € à�	‰	×Ñ˜d×/Ñ/°Ó=Õ>r1   c                 óX   • U R                   R                  U R                  U5      5        g)z$:see: ``MultiListbox.show_column()``N)rC  râ   r\   r�  s     r-   râ   ÚTable.show_column™  r�  r1   c                 ób   • U R                   R                  5       nU(       a  [        US   5      $ g)z“
Return the index of the currently selected row, or None if
no row is selected.  To get the row value itself, use
``table[table.selected_row()]``.
r   N)rC  r¢   rJ   )r,   Úsels     r-   Úselected_rowÚTable.selected_row¡  s*   € ð �i‰i×$Ñ$Ó&ˆÞÜ�s˜1‘v“;Ðàr1   c                 ó<   • U R                   R                  XU5        g)z:see: ``MultiListbox.select()``N)rC  rB   r¦   s       r-   rB   ÚTable.select­  s   € à�	‰	×Ñ˜ sÕ+r1   c                 óº  • US;  a  [        S5      eU R                  U5      nU R                  SS9nUS:X  a*  XR                  :X  a  U R                  R                  5         O7U R                  R                  [        R                  " U5      US:H  S9  Xl        U R                  5         U R                  USSS9  U R                  (       a  U R                  5         g	g	)
ab  
Sort the rows in this table, using the specified column's
values as a sort key.

:param column_index: Specifies which column to sort, using
    either a column index (int) or a column's label name
    (str).

:param order: Specifies whether to sort the values in
    ascending or descending order:

      - ``'ascending'``: Sort from least to greatest.
      - ``'descending'``: Sort from greatest to least.
      - ``'toggle'``: If the most recent call to ``sort_by()``
        sorted the table by the same column (``column_index``),
        then reverse the rows; otherwise sort in ascending
        order.
)Ú	ascendingÚ
descendingÚtogglezBsort_by(): order should be "ascending", "descending", or "toggle".T)Úindex_by_idr›  rš  )r°   Úreverse)rœ  r¥   N)rN   r\   r|  rG  rA  r�  ÚsortÚoperatorÚ
itemgetterrI  r}  rf  rg  )r,   r\   Úorderr~  s       r-   Úsort_byÚTable.sort_byµ  sÑ   € ð& Ð=Ó=ÜØWóð ð ×(Ñ(¨Ó6ˆØ×.Ñ.¸4Ð.Ð@ˆð �HÓ ·±Ó!>Ø�J‰J×ÑÕ à�J‰J�O‰OÜ×'Ò'¨Ó5ÀÈÑ@Uð ñ ð )ŒMð 	×ÑÔØ×!Ñ! -¸TÀtÐ!ÑLØ�;�;Ø×$Ñ$Õ&ð r1   c                 ó”   • UR                   R                  nU R                  R                  U5      (       a  gU R	                  U5        g)zDEvent handler for clicking on a column label -- sort by
that column.Úcontinue)rr   r\   rC  r`   r¢  )r,   rz   r\   s      r-   rH  ÚTable._sortÞ  s>   € ð —|‘|×0Ñ0ˆð �9‰9×#Ñ# E×*Ñ*Øð �L‰L˜Ô&Ør1   c           
      ó4  • U R                   R                  SS5        [        U R                  5       H]  u  p#U R                  b/  [        U5       VVs/ s H  u  pEU R	                  X$U5      PM     nnnU R                   R                  SU5        M_     gs  snnf )aL  
Re-draw the table from scratch, by clearing out the table's
multi-column listbox; and then filling it in with values from
``self._rows``.  Note that any cell-, row-, or column-specific
color configuration that has been done will be lost.  The
selection will also be lost -- i.e., no row will be selected
after this call completes.
r   r’   N)rC  r  rW   rA  r>  rÈ   )r,   Úsave_configrh   r!   ri  r  s         r-   rI  ÚTable._fill_tableñ  ss   € ð 	�	‰	×Ñ˜˜EÔ"Ü §
¡
Ö+‰FˆAØ�~‰~Ñ)Ü=FÀs¼^ÔLº^±6°A�t—~‘~ a¨AÖ.¹^�ÑLØ�I‰I×Ñ˜U CÖ(ò ,ùãLs   ÁBc           	      ól   • S Vs0 s H"  nX0R                   R                  XU5      S   _M$     sn$ s  snf )N)r   rÀ   r   r   r'   )rC  r(  )r,   ÚrrM  Úks       r-   Ú_get_itemconfigÚTable._get_itemconfig   sF   € ñó
ò�ð �y‰y×#Ñ# A¨!Ó,¨RÑ0Ò0ññ
ð 	
ùò 
s   …)1Fc                 óH  • Uc'  [        [        [        U R                  5      5      5      nU R	                  5       nU(       a  Ub  [        U R                  U   5      nU(       a`  U VVs0 s HN  n[        U R                  U   5      [        U R                  5       Vs/ s H  oPR                  XE5      PM     sn_MP     nnnX64$ U VVs0 s H8  nU[        U R                  5       Vs/ s H  oPR                  XE5      PM     sn_M:     nnnX64$ s  snf s  snnf s  snf s  snnf )aÂ  
Return a 'cookie' containing information about which row is
selected, and what color configurations have been applied.
this information can the be re-applied to the table (after
making modifications) using ``_restore_config_info()``.  Color
configuration information will be saved for any rows in
``row_indices``, or in the entire table, if
``row_indices=None``.  If ``index_by_id=True``, the the cookie
will associate rows with their configuration information based
on the rows' python id.  This is useful when performing
operations that re-arrange the rows (e.g. ``sort``).  If
``index_by_id=False``, then it is assumed that all rows will be
in the same order when ``_restore_config_info()`` is called.
)rK   rL   rM   rA  r”  Úidr=  r­  )r,   Úrow_indicesrœ  Ú	selectionr«  rM  Úconfigs          r-   r|  ÚTable._save_config_info  s,  € ð  ÑÜœu¤S¨¯©£_Ó5Ó6ˆKð ×%Ñ%Ó'ˆ	Þ˜9Ñ0Ü˜4Ÿ:™: iÑ0Ó1ˆIö ñ
 %ô	ò %�Aô �4—:‘:˜a‘=Ó!Ü8=¸d×>OÑ>OÔ8Pó$Ú8P°1×(Ñ(¨Ö.Ñ8Pñ$ò ñ %ð	 ñ ð Ð Ð ñ %ôâ$�Að ¼¸d×>OÑ>OÔ8PÓQÒ8P°1×(Ñ(¨Ö.Ñ8PÑQÒQÙ$ð ñ ð
 Ð Ð ùò$ùóùò Rùós0   Á)4DÂDÂ7DÃ	DÃ'DÄDÄDÄDc           
      óZ  • Uu  pEUc  U R                   R                  SS5        U(       aŸ  [        U R                  5       H…  u  pg[	        U5      U;   aG  [        U R                  5       H.  nU R                   R                  XhU[	        U5         U   5        M0     [	        U5      U:X  d  Ml  U R                   R                  XcS9  M‡     gUb  U R                   R                  XCS9  U H@  n[        U R                  5       H$  nU R                   R                  XhXV   U   5        M&     MB     g)za
Restore selection & color configuration information that was
saved using ``_save_config_info``.
Nr   r’   )r¥   )	rC  r”   rW   rA  r°  rL   r=  r¹   rB   )	r,   Úcookierœ  r¥   r²  r³  r«  r!   rM  s	            r-   r}  ÚTable._restore_config_info3  sû   € ð
 #Ñˆ	ð ÑØ�I‰I×%Ñ% a¨Ô/ö Ü# D§J¡JÖ/‘�Ü�c“7˜fÓ$Ü" 4×#4Ñ#4Ö5˜ØŸ	™	×/Ñ/°°f¼RÀ»W±oÀaÑ6HÖIñ 6ä�c“7˜iÕ'Ø—I‘I×$Ñ$ QÐ$Ó0ò 0ð Ñ$Ø—	‘	× Ñ  Ð Ñ4Û�Ü˜t×0Ñ0Ö1�AØ—I‘I×+Ñ+¨A°&±)¸A±,Ö?ó 2ò r1   c                 óø  • U R                   R                   H"  n[        U 5      UR                  5       :X  a  M"   e   U  H  n[        U5      U R                  :X  a  M   e   U R                  [        U R                   R
                  5      :X  d   e[        U 5       H\  u  p2[        U5       HH  u  pEU R                  b  U R                  X4U5      nU R                   R                  U5      U   U:X  a  MH   e   M^     g)zæ
Verify that the contents of the table's ``_rows`` variable match
the contents of its multi-listbox (``_mlb``).  This is just
included for debugging purposes, to make sure that the
list-modifying operations are working correctly.
N)	rC  r�   rM   r¤   r=  r‰   rW   r>  rÎ   )r,   rÖ   r!   rh   ri  Úcells         r-   rg  ÚTable._check_table_vs_mlbU  sÏ   € ð —9‘9×&Ô&ˆCÜ�t“9 §¡£
Õ*Ð*Ð*ñ 'ãˆCÜ�s“8˜t×0Ñ0Õ0Ð0Ð0ñ à× Ñ ¤C¨¯	©	×(>Ñ(>Ó$?Ó?Ð?Ð?ä –o‰FˆAÜ$ Sž>‘�Ø—>‘>Ñ-ØŸ>™>¨!°Ó5�DØ—y‘y—}‘} QÓ'¨Ñ*¨dÕ2Ð2Ð2ó *ò &r1   )r@  r?  rC  r=  r>  rA  rF  rG  r!  r4   r   )r›  )T)NF)FF),r"  r#  r$  r%  r&  rT   rD  r[   r—   r^   r»   rÂ   r¹   rè   rë   rï   r)  r*  r(  rÈ   rm  rZ   rs  ry  rµ   r�  r„  rB  r'  r‰   r\   rß   râ   r”  rB   r¢  rH  rI  r­  r|  r}  rf  rg  r/  r>   r1   r-   r1  r1  E  sÿ   † ñ$ðT ØØØØØôMòh*ò
*ò
ô,ð
 +-ô 5ð .0ô 8ô
Hô
=ô@ô>ð €IØ"€LØ€Jò'ò('ò	'ò'ò,ò %5òN'òò	ð ñ&ó ð&ò1ò?ò?ò
ô,ô''òRô&)ò	
ô&!ôP@ð< €Fð#õ3r1   r1  c            	      ó‚  ^
• [        5       m
T
R                  SU
4S j5        [        T
SR                  5       / SQS S9n U R	                  SSS	9  S
SKJnJn  [        [        UR                  5       S S 5      5       H�  u  p4US
   S:w  a  M  UR                  5       nUR                  U5       Hh  n UR                  5       S
   R                  5       n UR                  5       S
   R                  5       nU R                  X5R                  5       Xg/5        Mj     MŸ     U R!                  SSS9  U R!                  SSS9  U R!                  SSS9  U R!                  SSS9  [#        [%        U 5      5       H)  nS H   n	XU	4   S:X  d  M  U R'                  X‰SSS9  M"     M+     T
R)                  5         g !   Sn Nã= f!   Sn NÊ= f)Nz<Control-q>c                 ó$   >• TR                  5       $ r4   )Údestroy)r+   Úroots    €r-   r.   Údemo.<locals>.<lambda>q  s   ø€  t§|¡|¤~r1   zWord Synset Hypernym Hyponym)r   r   r   r   c                 ó   • SU-  $ )Nz  %sr>   )rh   ri  Úss      r-   r.   r¿  w  s   €  &¨1¢*r1   )rd   rL  Tr4  )r6  r7  r   )ÚbrownÚwordnetiô  ÚNz*none*ÚWordz#afa)r   ÚSynsetz#efeÚHypernymz#feeÚHyponymz#ffe)rÇ  rÈ  z#666)r   rÀ   )r   r^   r1  ÚsplitrD  Únltk.corpusrÂ  rÃ  ÚsortedrE  Útagged_wordsÚlowerÚsynsetsÚ	hypernymsÚ
definitionrZ   r*  rL   rM   r(  Úmainloop)ÚtablerÂ  rÃ  ÚwordÚposÚsynsetÚ	hyper_defÚhypo_defr!   r    r¾  s             @r-   ÚdemorØ  o  s³  ø€ Ü‹4€DØ‡I�IˆmÔ5Ô6äØØ&×,Ñ,Ó.Ú#Ù,ñ	€Eð 
‡J�J�d €JÑ(ç*äœC × 2Ñ 2Ó 4°T°cÐ :Ó;Ö<‰	ˆØˆq‰6�S‹=ÙØ�z‰z‹|ˆØ—o‘o dÖ+ˆFð%Ø"×,Ñ,Ó.¨qÑ1×<Ñ<Ó>�	ð$Ø!×+Ñ+Ó-¨aÑ0×;Ñ;Ó=�ð �L‰L˜$× 1Ñ 1Ó 3°YÐIÖJó ,ñ	 =ð 
×Ñ�v¨&ÐÑ1Ø	×Ñ�x¨FÐÑ3Ø	×Ñ�z¨fÐÑ5Ø	×Ñ�y¨VÐÑ4Ü”S˜“ZÖ ˆÛ-ˆFØ˜&�[Ñ! XÕ-Ø× Ñ Ø¨FÀVð !ó ó .ñ !ð 	‡M�M…Oøð%%Ø$’	ûð$Ø#’ús   Â1!F/Ã!F8Æ/F5Æ8F>Ú__main__)r&  rŸ  Útkinterr   r   r   r   r   r	   r1  rØ  r"  r>   r1   r-   Ú<module>rÛ     sK   ðñó ß 8Õ 8ôb�5ô b÷ba3ñ a3òT'ðT ˆzÓÙ…Fð r1   