
    .hho                    Z   S r SSKrSSKrSSKrSSKrSSKr\R                  rSSK7  SSKrSr	Sr
\" \R                  5      r\" \R                  5      r\R                   r\R"                  r\R$                  r\R&                  " S5      r\R&                  " S\R*                  5      rS rS	 rS
 r\R2                  rS r\R6                  rSuS jr " S S\R:                  " SS5      5      rS r\R@                  " \RB                  5       " S S5      5       r" " S S5      r#Sq$Sq%S r&SvS jr'S r(S r)S r*SwS jr+Sq, " S S5      r- " S S\-5      r. " S  S!\-5      r/ " S" S#\-5      r0 " S$ S%\-5      r1SwS& jr2\3r4\r5S' r6 " S( S)5      r7 " S* S+5      r8 " S, S-5      r9 " S. S/5      r: " S0 S15      r; " S2 S3\7\;5      r<\Rz                  S4.S5 jr>SxS6 jr? " S7 S85      r@ " S9 S:5      rA " S; S<5      rB " S= S>\75      rC " S? S@\C\@\A\B5      rD " SA SB\C\;5      rE " SC SD\D5      rF " SE SF\D\9\:5      rGSqH " SG SH\D5      rI " SI SJ\D\95      rJ " SK SL\D5      rK " SM SN\D5      rL " SO SP\D\9\:5      rM " SQ SR\D5      rN " SS ST\D5      rO " SU SV\D5      rP " SW SX\D5      rQ " SY SZ\D5      rR " S[ S\\D5      rS " S] S^\D\9\:5      rT " S_ S`5      rU " Sa Sb\O5      rV " Sc Sd5      rW " Se Sf\W5      rX " Sg Sh\W5      rYSi rZSj r[ " Sk Sl\D\95      r\ " Sm Sn\D5      r] " So Sp\D5      r^Sq r_\`" 5       R                  5        V Vs/ s HA  u  pU R                  Sr5      (       a  M  \c" U\R                  5      (       a  M7  U Ss;  d  M?  U PMC     snn re\fSt:X  a  \_" 5         gg! \ a     GNf = f! \ a     GNf = fs  snn f )ya>  Wrapper functions for Tcl/Tk.

Tkinter provides classes which allow the display, positioning and
control of widgets. Toplevel widgets are Tk and Toplevel. Other
widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton,
Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox
LabelFrame and PanedWindow.

Properties of the widgets are specified with keyword arguments.
Keyword arguments have the same name as the corresponding options
under Tk.

Widgets are positioned with one of the geometry managers Place, Pack
or Grid. These managers can be called with methods place, pack, grid
available in every Widget.

Actions are bound to events by options (e.g. the command
keyword argument) or with the bind() method.

Example (Hello, World):
import tkinter
from tkinter.constants import *
tk = tkinter.Tk()
frame = tkinter.Frame(tk, relief=RIDGE, borderwidth=2)
frame.pack(fill=BOTH, expand=1)
label = tkinter.Label(frame, text="Hello, World")
label.pack(fill=X, expand=1)
button = tkinter.Button(frame, text="Exit", command=tk.destroy)
button.pack(side=BOTTOM)
tk.mainloop()
    N)*   Fz([\\{}])z([\s])c                 @    SR                  [        [        U 5      5      $ )Internal function. )joinmap
_stringifyvalues    9/opt/python-3.13.8/usr/lib/python3.13/tkinter/__init__.py_joinr   :   s    88C
E*++    c                 j   [        U [        [        45      (       aO  [        U 5      S:X  a/  [	        U S   5      n [
        R                  U 5      (       a  SU -  n U $ S[        U 5      -  n  U $ [        U [        5      (       a  [        U S5      n O[        U 5      n U (       d  Sn U $ [
        R                  U 5      (       aN  [
        R                  SU 5      n U R                  SS5      n [        R                  SU 5      n U S   S	:X  a  S
U -   n U $ U S   S	:X  d  [        R                  U 5      (       a  SU -  n U $ )r   r   r   z{%s}latin1z{}z\\\1
z\n"\)
isinstancelisttuplelenr
   	_magic_researchr   bytesstrsubreplace	_space_rer   s    r   r
   r
   ?   s    %$''u:?uQx(E&&& L# U5\)E" L eU##x(EJEE L e$$MM'51EMM$.EMM'51EQx3u L 1X_	 0 0 7 7UNELr   c                     SnU  H8  n[        U[        [        45      (       a  U[        U5      -   nM.  Uc  M3  X4-   nM:     U$ )r    )r   r   r   _flatten)seqresitems      r   r"   r"   [   sF    
CdUDM**&C-C	 
 Jr   c                 R   [        U [        5      (       a  U $ [        U [        S5      [        45      (       a  U $ 0 n[	        U 5       H  n UR                  U5        M     U$ ! [        [        4 a4  n[        SU5        UR                  5        H	  u  pEXQU'   M      SnAMZ  SnAff = f)r   Nz_cnfmerge: fallback due to:)
r   dicttyper   r"   updateAttributeError	TypeErrorprintitems)cnfscnfcmsgkvs         r   	_cnfmerger4   j   s    $	D4:s+	,	,$A

1   
	 #I. 3S9GGIDAF &s   A""B&2)B!!B&Tc                    U R                  U5      n[        U5      S-  (       a  [        S5      e[        U5      n0 n[	        XU5       H8  u  px[        U5      nU(       a  US   S:X  a  USS nU(       a  U" U5      nXU'   M:     U$ )zReturn a properly formatted dict built from Tcl list pairs.

If cut_minus is True, the supposed '-' prefix will be removed from
keys. If conv is specified, it is used to convert values.

Tcl list is expected to contain an even number of elements.
   zNTcl list representing a dict is expected to contain an even number of elementsr   -r   N)	splitlistr   RuntimeErroriterzipr   )	tkr3   	cut_minusconvtitr'   keyr   s	            r   
_splitdictrB      s     	QA
1vz C D 	D	aBD"k
#hQ3ab'CKES	 " Kr   c                       \ rS rSrS rSrg)_VersionInfoType   c                     U R                   S:X  a(  U R                   SU R                   SU R                   3$ U R                   SU R                   U R                   S    U R                   3$ )Nfinal.r   )releaselevelmajorminormicroserialselfs    r   __str___VersionInfoType.__str__   sd    'jj\4::,a

|<<jj\4::,t/@/@/C.DT[[MRRr   r!   N)__name__
__module____qualname____firstlineno__rP   __static_attributes__r!   r   r   rD   rD      s    Sr   rD   )rJ   rK   rL   rI   rM   c                     SS K nUR                  " SU 5      nUR                  5       u  p4pV[        U5      [        U5      [        U5      pdnUS:X  a  UnSnSnO
SnSSS.U   n[	        X4XuU5      $ )Nr   z(\d+)\.(\d+)([ab.])(\d+)rH   rG   alphabeta)ab)re	fullmatchgroupsintrD   )versionr\   mrJ   rK   rI   rM   rL   s           r   _parse_versionrb      sw    
0':A)*&E,u:s5z3v;&Es$62<@E%vFFr   c                       \ rS rSrSr\rSrSr\rSr	Sr
SrSrS	rS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!Sr"Sr#S r$S!r%S"r&S#r'S$r(S%r)S&r*S'r+g())	EventType   234567891011121314151617181920212223242526272829303132333435363738r!   N),rR   rS   rT   rU   KeyPressKey
KeyReleaseButtonPressButtonButtonReleaseMotionEnterLeaveFocusInFocusOutKeymapExposeGraphicsExposeNoExpose
VisibilityCreateDestroyUnmapMap
MapRequestReparent	ConfigureConfigureRequestGravityResizeRequest	CirculateCirculateRequestPropertySelectionClearSelectionRequest	SelectionColormapClientMessageMappingVirtualEventActivate
Deactivate
MouseWheelrV   r!   r   r   rd   rd      s    H
CJKFMFEEGHFFNHJFGE
CJHIGMIHNIHMGLHJJr   rd   c                       \ rS rSrSrS rSrg)Event   a:  Container for the properties of an event.

Instances of this type are generated if one of the following events occurs:

KeyPress, KeyRelease - for keyboard events
ButtonPress, ButtonRelease, Motion, Enter, Leave, MouseWheel - for mouse events
Visibility, Unmap, Map, Expose, FocusIn, FocusOut, Circulate,
Colormap, Gravity, Reparent, Property, Destroy, Activate,
Deactivate - for window events.

If a callback function for one of these events is registered
using bind, bind_all, bind_class, or tag_bind, the callback is
called with an Event as first argument. It will have the
following attributes (in braces are the event types for which
the attribute is valid):

    serial - serial number of event
num - mouse button pressed (ButtonPress, ButtonRelease)
focus - whether the window has the focus (Enter, Leave)
height - height of the exposed window (Configure, Expose)
width - width of the exposed window (Configure, Expose)
keycode - keycode of the pressed key (KeyPress, KeyRelease)
state - state of the event as a number (ButtonPress, ButtonRelease,
                        Enter, KeyPress, KeyRelease,
                        Leave, Motion)
state - state as a string (Visibility)
time - when the event occurred
x - x-position of the mouse
y - y-position of the mouse
x_root - x-position of the mouse on the screen
         (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion)
y_root - y-position of the mouse on the screen
         (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion)
char - pressed character (KeyPress, KeyRelease)
send_event - see X/Windows documentation
keysym - keysym of the event as a string (KeyPress, KeyRelease)
keysym_num - keysym of the event as a number (KeyPress, KeyRelease)
type - type of the event as a number
widget - widget in which the event occurred
delta - delta of wheel movement (MouseWheel)
c                 b  ^	 U R                   R                  5        VVs0 s H  u  pUS:w  d  M  X_M     snnm	U R                  (       d  T	S	 O(U R                  S:w  a  [        U R                  5      T	S'   [	        U SS5      (       d  T	S	 U R
                  S:X  a  T	S	 O[        U R
                  [        5      (       a  U R
                  nSn/ n[        U5       H%  u  pgUSU-  -  (       d  M  UR                  U5        M'     US[        U5      -  S-
  ) -  nU(       d  U(       d  UR                  [        U5      5        S	R                  U5      T	S'   U R                  S:X  a  T	S
	 SnS[	        U R                  SU R                  5      < SSR                  U	4S jU 5       5      < S3$ s  snnf )Nz??char
send_eventTr   state)ShiftLockControlMod1Mod2Mod3Mod4Mod5Button1Button2Button3Button4Button5r   |delta)r   r   keysymkeycoder   numr   focusxywidthheight<namez event c              3   L   >#    U  H  oT;   d  M
  S U< STU   < 3v   M     g7f)r   =Nr!   ).0r2   attrss     r   	<genexpr>!Event.__repr__.<locals>.<genexpr>'  s#     Id5j,j58,ds   	$$>)__dict__r-   r   reprgetattrr   r   r_   	enumerateappendr   hexr   r   r(   )
rO   r2   r3   r   modssinkeysr   s
            @r   __repr__Event.__repr__  sm   "&--"5"5"7E"7$!19"7EyyfYY$ OE&Mt\400l#::?g

C((JJEKD A!$AF##HHQK ( q3t9}122EAU$ XXa[E'N::?g
-
 DIIvtyy1GGIdII
 	
A Fs
   F+F+r!   N)rR   rS   rT   rU   __doc__r   rV   r!   r   r   r   r      s    (T$
r   r   c                      Sq SqBg)zInhibit setting of default root window.

Call this function to inhibit that the first instance of
Tk is used for windows without an explicit parent window.
FN)_support_default_root_default_rootr!   r   r   NoDefaultRootr   /  s     " Mr   c                     [         (       d  [        S5      e[        c   U (       a  [        SU  S35      e[        5       n[        $ )NINo master specified and tkinter is configured to not support default rootzToo early to z: no default root window)r   r9   r   Tk)whatroots     r   _get_default_rootr   =  sH       D E 	Etf4LMNNtr   c                      [         (       d  [        S5      e[        n U c%  Sq [        5       n Sq U R	                  5         SU l        U $ )Nr   FT)r   r9   r   r   withdraw
_temporaryr   s    r   _get_temp_rootr   I  sO       D E 	ED| %t $Kr   c                 l    [        U SS5      (       a   U R                  5         g g ! [         a     g f = f)Nr   F)r   destroyTclErrormasters    r   _destroy_temp_rootr   Z  s9    v|U++	NN ,  		s   & 
33c                     gr   Nr!   )errs    r   _tkerrorr   b  s    r   c                 P     [        U 5      n [        U 5      e! [         a     Nf = f)zBInternal function. Calling it will raise the exception SystemExit.)r_   
ValueError
SystemExit)codes    r   _exitr  g  s1    4y T
  s    
%%c                   ~    \ rS rSrSrSrSrSrSS jrS r	S r
S r\rS	 rS
 rS rS rS rS r\rS rS rS rSrg)Variableis  zClass to define value holders for e.g. buttons.

Subclasses StringVar, IntVar, DoubleVar, BooleanVar are specializations
that constrain the type of the value returned from get().r   Nc                    Ub   [        U[        5      (       d  [        S5      eUc  [        S5      nUR	                  5       U l        UR
                  U l        U(       a  X0l        O S[        [        5      -   U l        [        S-  q	Ub  U R                  U5        gU R                  R                  U R                  R                  SSU R                  5      5      (       d  U R                  U R                  5        gg)zConstruct a variable

MASTER can be given as master widget.
VALUE is an optional value (defaults to "")
NAME is an optional Tcl name (defaults to PY_VARnum).

If NAME matches an existing variable and VALUE is omitted
then the existing value is retained.
Nzname must be a stringzcreate variablePY_VARr   infoexists)r   r   r+   r   _rootr<   _tk_namer   _varnum
initialize
getbooleancall_defaultrO   r   r   r   s       r   __init__Variable.__init__|  s     JtS$9$9344>&'89F\\^
99J!DM1DJqLGOOE"$$TXX]]68TZZ%PQQOODMM* Rr   c                 z   U R                   c  gU R                   R                  U R                   R                  SSU R                  5      5      (       a%  U R                   R	                  U R                  5        U R
                  b6  U R
                   H  nU R                   R                  U5        M      SU l        gg)zUnset the variable in Tcl.Nr
  r  )r  r  r  r  globalunsetvar_tclCommandsdeletecommandrO   r   s     r   __del__Variable.__del__  s    8888txx}}VXtzzJKKHH##DJJ/())&&t, * $D )r   c                     U R                   $ )z'Return the name of the variable in Tcl.)r  rN   s    r   rP   Variable.__str__  s    zzr   c                 N    U R                   R                  U R                  U5      $ zSet the variable to VALUE.)r  globalsetvarr  rO   r   s     r   setVariable.set  s    xx$$TZZ77r   c                 L    U R                   R                  U R                  5      $ )zReturn value of variable.)r  globalgetvarr  rN   s    r   getVariable.get  s    xx$$TZZ00r   c                 |   [        US U R                  5      R                  n[        [	        U5      5      n UR
                  n X1R                  -   nU R                  R                  X25        U R                  c  / U l
        U R                  R                  U5        U$ ! [         a     Ngf = f! [         a     Nhf = fN)CallWrapperr  __call__r   id__func__r*   rR   r  createcommandr  r   )rO   callbackfcbnames       r   	_registerVariable._register  s    $

3<<be	((H	///F 	v)$ "D  (  		  		s#   B B. 
B+*B+.
B;:B;c                 |    U R                  U5      nU R                  R                  SSSU R                  X45        U$ )zDefine a trace callback for the variable.

Mode is one of "read", "write", "unset", or a list or tuple of
such strings.
Callback must be a function which is called when the variable is
read, written or unset.

Return the name of the callback.
traceaddvariabler4  r  r  r  rO   moder1  r3  s       r   	trace_addVariable.trace_add  s8     )gujjj$		3r   c                 ^   U R                   R                  SSSU R                  X5        U R                  5        H)  u  p4U R                   R	                  U5      S   U:X  d  M)    g   U R                   R                  U5         U R                  R                  U5        g! [         a     gf = f)zDelete the trace callback for a variable.

Mode is one of "read", "write", "unset" or a list or tuple of
such strings.  Must be same as were specified in trace_add().
cbname is the name of the callback returned from trace_add().
r7  remover9  r   N)	r  r  r  
trace_infor8   r  r  r@  r  rO   r<  r3  ra   cas        r   trace_removeVariable.trace_remove  s     	gxjj$	0__&EAxx!!"%a(F2 ' HH""6*!!((0 s   B 
B,+B,c                     U R                   R                  n[        UU" U R                   R                  SSSU R                  5      5      5       VVs/ s H  u  p#U" U5      U4PM     snn$ s  snnf )z&Return all trace callback information.r7  r
  r9  )r  r8   r	   r  r  )rO   r8   r2   r3   s       r   rA  Variable.trace_info  so    HH&&	.1)dhhmmGVZLM/O P /Oda1q! /O P 	P Ps   A,c                 x    U R                  U5      nU R                  R                  SSU R                  X5        U$ )a]  Define a trace callback for the variable.

MODE is one of "r", "w", "u" for read, write, undefine.
CALLBACK must be a function which is called when
the variable is read, written or undefined.

Return the name of the callback.

This deprecated method wraps a deprecated Tcl method that will
likely be removed in the future.  Use trace_add() instead.
r7  r9  r:  r;  s       r   trace_variableVariable.trace_variable  s1     )gz4::tDr   c                    U R                   R                  SSU R                  X5        U R                   R                  U5      S   nU R	                  5        H)  u  p4U R                   R                  U5      S   U:X  d  M)    g   U R                   R                  U5         U R                  R                  U5        g! [         a     gf = f)a+  Delete the trace callback for a variable.

MODE is one of "r", "w", "u" for read, write, undefine.
CBNAME is the name of the callback returned from trace_variable or trace.

This deprecated method wraps a deprecated Tcl method that will
likely be removed in the future.  Use trace_remove() instead.
r7  vdeleter   N)	r  r  r  r8   rA  r  r  r@  r  rB  s        r   trace_vdeleteVariable.trace_vdelete  s     	gy$**dC##F+A.__&EAxx!!"%a(F2 ' HH""6*!!((0 s    B< <
C	C	c                     U R                   R                  U R                   R                  SSU R                  5      5       Vs/ s H  oR                   R                  U5      PM     sn$ s  snf )zReturn all trace callback information.

This deprecated method wraps a deprecated Tcl method that will
likely be removed in the future.  Use trace_info() instead.
r7  vinfo)r  r8   r  r  rO   r   s     r   trace_vinfoVariable.trace_vinfo  s^     04xx/A/AHHMM'7DJJ709 : 09!""1% 09 : 	: :s   $A*c                    [        U[        5      (       d  [        $ U R                  UR                  :H  =(       aM    U R                  R
                  UR                  R
                  :H  =(       a    U R                  UR                  :H  $ r+  )r   r  NotImplementedr  	__class__rR   r  )rO   others     r   __eq__Variable.__eq__  s`    %**!!

ekk) *NN++u/G/GG*HH		)	+r   )r  r  r  r  NNN)rR   rS   rT   rU   r   r  r  r  r  r  rP   r$  r  r(  r4  r=  rD  rA  rI  r7  rM  rR  rX  rV   r!   r   r   r  r  s  si    A H
CL+<	%8 J1"&P" E,:+r   r  c                   ,    \ rS rSrSrSrSS jrS rSrg)		StringVari'  z#Value holder for strings variables.r   Nc                 0    [         R                  XX#5        g)a  Construct a string variable.

MASTER can be given as master widget.
VALUE is an optional value (defaults to "")
NAME is an optional Tcl name (defaults to PY_VARnum).

If NAME matches an existing variable and VALUE is omitted
then the existing value is retained.
Nr  r  r  s       r   r  StringVar.__init__+       	$4r   c                     U R                   R                  U R                  5      n[        U[        5      (       a  U$ [	        U5      $ )z#Return value of variable as string.)r  r'  r  r   r   r#  s     r   r(  StringVar.get7  s6    %%djj1eS!!L5zr   r!   rZ  	rR   rS   rT   rU   r   r  r  r(  rV   r!   r   r   r\  r\  '  s    -H
5r   r\  c                   ,    \ rS rSrSrSrSS jrS rSrg)	IntVari?  z#Value holder for integer variables.r   Nc                 0    [         R                  XX#5        g)a  Construct an integer variable.

MASTER can be given as master widget.
VALUE is an optional value (defaults to 0)
NAME is an optional Tcl name (defaults to PY_VARnum).

If NAME matches an existing variable and VALUE is omitted
then the existing value is retained.
Nr^  r  s       r   r  IntVar.__init__C  r`  r   c                     U R                   R                  U R                  5      n U R                   R                  U5      $ ! [        [
        4 a'    [        U R                   R                  U5      5      s $ f = f)z/Return the value of the variable as an integer.)r  r'  r  getintr+   r   r_   	getdoubler#  s     r   r(  
IntVar.getO  s`    %%djj1	288??5))8$ 	2txx))%011	2s   A 4A98A9r!   rZ  rc  r!   r   r   re  re  ?  s    -H
52r   re  c                   ,    \ rS rSrSrSrSS jrS rSrg)		DoubleVariX  z!Value holder for float variables.g        Nc                 0    [         R                  XX#5        g)a  Construct a float variable.

MASTER can be given as master widget.
VALUE is an optional value (defaults to 0.0)
NAME is an optional Tcl name (defaults to PY_VARnum).

If NAME matches an existing variable and VALUE is omitted
then the existing value is retained.
Nr^  r  s       r   r  DoubleVar.__init__\  r`  r   c                 ~    U R                   R                  U R                   R                  U R                  5      5      $ )z,Return the value of the variable as a float.)r  rj  r'  r  rN   s    r   r(  DoubleVar.geth  s*    xx!!$(("7"7

"CDDr   r!   rZ  rc  r!   r   r   rm  rm  X  s    +H
5Er   rm  c                   6    \ rS rSrSrSrS	S jrS r\rS r	Sr
g)

BooleanVarim  z#Value holder for boolean variables.FNc                 0    [         R                  XX#5        g)a
  Construct a boolean variable.

MASTER can be given as master widget.
VALUE is an optional value (defaults to False)
NAME is an optional Tcl name (defaults to PY_VARnum).

If NAME matches an existing variable and VALUE is omitted
then the existing value is retained.
Nr^  r  s       r   r  BooleanVar.__init__q  r`  r   c                     U R                   R                  U R                  U R                   R                  U5      5      $ r!  )r  r"  r  r  r#  s     r   r$  BooleanVar.set}  s,    xx$$TZZ1D1DU1KLLr   c                      U R                   R                  U R                   R                  U R                  5      5      $ ! [         a    [        S5      ef = f)z+Return the value of the variable as a bool. invalid literal for getboolean())r  r  r'  r  r   r  rN   s    r   r(  BooleanVar.get  sM    	A88&&txx'<'<TZZ'HII 	A?@@	As   =A   Ar!   rZ  )rR   rS   rT   rU   r   r  r  r$  r  r(  rV   r!   r   r   rs  rs  m  s"    -H
5M JAr   rs  c                 L    [        S5      R                  R                  U 5        g)zRun the main loop of Tcl.zrun the main loopN)r   r<   mainloop)r   s    r   r|  r|    s    )*--66q9r   c                 ~     [        S5      R                  R                  U 5      $ ! [         a    [	        S5      ef = f)z$Convert Tcl object to True or False.zuse getboolean()ry  )r   r<   r  r   r  )r   s    r   r  r    s?    = !3477BB1EE =;<<=s   #& <c                      \ rS rSrSrSrSrS rS rSS jr	S r
S rSS	 jr\rSS
 jrSS jrSS jrSS jrS rS rS rS r\rS rS rS rS rS rS rS rSS jrS rS r SS jr!SS jr"S r#\#r$SS jr%\%=r&=r'r(SS  jr)\)r*S! r+\+r,S" r-\-=r.=r/r0S# r1\1r2S$ r3S% r4S& r5S' r6S( r7S) r8S* r9S+ r:SS, jr;S- r<S. r=SS/ jr>S0 r?S1 r@S2 rAS3 rBS4 rCS5 rDSS6 jrESS7 jrF\FrGS8 rHSS9 jrISS: jrJS; rKS< rLS= rMS> rNSS? jrOS@ rPSA rQSB rRSC rSSD rTSE rUSSF jrVSG rWSH rXSI rYSJ rZSSK jr[SL r\SM r]SN r^SO r_SP r`SQ raSR rbSS rcST rdSU reSV rfSW rgSX rhSY riSZ rjS[ rkS\ rlS] rmS^ rnS_ roS` rpSa rqSSb jrrSc rsSd rtSe ruSf rvSg rwSh rxSi rySj rzSk r{Sl r|Sm r}SSn jr~SSo jrSSp jrSSq jrSSr jrSSs jrSt rSSu jrSv rSSw jrSx rSy rSz rS{ rS| r\S} 5       rSS~ jrS r\rSS jr\rS rSrSGR-                  \5      rS rS rS rS rS rSS jr\rS r\rS rS rS rS rS/r\4S jr\rS r\rS rSS jr\rSS jr\rS rS r0 4S jr\rS r\4S jr0 4S jr\rS r\rSS jrS rS rS rSS jrS rS rSrg)Misci  zNInternal class.

Base class which defines methods common for interior widgets.Nc                     U R                   b6  U R                    H  nU R                  R                  U5        M      SU l         gg)z[Internal function.

Delete all Tcl commands created for
this widget in the Tcl interpreter.N)r  r<   r  r  s     r   r   Misc.destroy  s?    
 ())%%d+ * $D )r   c                     U R                   R                  U5         U R                  R                  U5        g! [         a     gf = f)z<Internal function.

Delete the Tcl command provided in NAME.N)r<   r  r  r@  r  r  s     r   r  Misc.deletecommand  sA     	d#	$$T* 		s   9 
AAc                 n    U R                   R                  U R                   R                  SSU5      5      $ )zSet Tcl internal variable, whether the look and feel
should adhere to Motif.

A parameter of 1 means adhere to Motif (e.g. no color
change if mouse passes over slider).
Returns the set value.r$  tk_strictMotif)r<   r  r  rO   booleans     r   r  Misc.tk_strictMotif  s2     ww!!$'',,#W#. / 	/r   c                 :    U R                   R                  S5        g)zDChange the color scheme to light brown as used in Tk 3.6 and before.	tk_bisqueNr<   r  rN   s    r   r  Misc.tk_bisque  s    [!r   c           	          U R                   R                  S[        U5      -   [        [        UR	                  5       5      5      -   5        g)a  Set a new color scheme for all widget elements.

A single color as argument will cause that all colors of Tk
widget elements are derived from this.
Alternatively several keyword parameters and its associated
colors can be given. The following keywords are valid:
activeBackground, foreground, selectColor,
activeForeground, highlightBackground, selectBackground,
background, highlightColor, selectForeground,
disabledForeground, insertBackground, troughColor.)tk_setPaletteN)r<   r  r"   r   r-   rO   argskws      r   r  Misc.tk_setPalette  s;     	'!)$rxxz*:!;< 	=r   c                 >    U R                   R                  SSU5        g)zsWait until the variable is modified.

A parameter of type IntVar, StringVar, DoubleVar or
BooleanVar must be given.tkwaitr9  Nr  r  s     r   wait_variableMisc.wait_variable  s    
 	Xz40r   c                 \    Uc  U nU R                   R                  SSUR                  5        g)zIWait until a WIDGET is destroyed.

If no parameter is given self is used.Nr  windowr<   r  _wrO   r  s     r   wait_windowMisc.wait_window  s&     >FXx3r   c                 \    Uc  U nU R                   R                  SSUR                  5        g)zhWait until the visibility of a WIDGET changes
(e.g. it appears).

If no parameter is given self is used.Nr  
visibilityr  r  s     r   wait_visibilityMisc.wait_visibility  s&    
 >FX|VYY7r   c                 :    U R                   R                  X5        g)zSet Tcl variable NAME to VALUE.N)r<   setvar)rO   r   r   s      r   r  Misc.setvar  s    t#r   c                 8    U R                   R                  U5      $ )z"Return value of Tcl variable NAME.)r<   getvarr  s     r   r  Misc.getvar  s    ww~~d##r   c                      U R                   R                  U5      $ ! [         a  n[        [	        U5      5      eS nAff = fr+  )r<   ri  r   r  r   rO   r   excs      r   ri  Misc.getint  s9    	'77>>!$$ 	'SX&&	'    
A ;A c                      U R                   R                  U5      $ ! [         a  n[        [	        U5      5      eS nAff = fr+  )r<   rj  r   r  r   r  s      r   rj  Misc.getdouble  s;    	'77$$Q'' 	'SX&&	'r  c                 l     U R                   R                  U5      $ ! [         a    [        S5      ef = f)zPReturn a boolean value for Tcl boolean values true and false given as parameter.ry  )r<   r  r   r  )rO   r   s     r   r  Misc.getboolean  s:    	A77%%a(( 	A?@@	As    3c                 P    U R                   R                  SU R                  5        g)zDirect input focus to this widget.

If the application currently does not have the focus
this widget will get the focus if the application gets
the focus through the window manager.r   Nr  rN   s    r   	focus_setMisc.focus_set  s     	Wdgg&r   c                 R    U R                   R                  SSU R                  5        g)zdDirect input focus to this widget even if the
application does not have the focus. Use with
caution!r   z-forceNr  rN   s    r   focus_forceMisc.focus_force  s     	Wh0r   c                 v    U R                   R                  S5      nUS:X  d  U(       d  gU R                  U5      $ )zReturn the widget which has currently the focus in the
application.

Use focus_displayof to allow working with several
displays. Return None if application does not have
the focus.r   noneN)r<   r  _nametowidgetr  s     r   	focus_getMisc.focus_get  s2     ww||G$6>d!!$''r   c                     U R                   R                  SSU R                  5      nUS:X  d  U(       d  gU R                  U5      $ )zReturn the widget which has currently the focus on the
display where this widget is located.

Return None if the application does not have the focus.r   
-displayofr  Nr<   r  r  r  r  s     r   focus_displayofMisc.focus_displayof(  s:    
 ww||G\477;6>d!!$''r   c                     U R                   R                  SSU R                  5      nUS:X  d  U(       d  gU R                  U5      $ )zqReturn the widget which would have the focus if top level
for this widget gets the focus from the window manager.r   z-lastforr  Nr  r  s     r   focus_lastforMisc.focus_lastfor1  s:     ww||GZ96>d!!$''r   c                 :    U R                   R                  S5        g)zPThe widget under mouse will get automatically focus. Can not
be disabled easily.tk_focusFollowsMouseNr  rN   s    r   r  Misc.tk_focusFollowsMouse8  s     	+,r   c                     U R                   R                  SU R                  5      nU(       d  gU R                  U5      $ )a<  Return the next widget in the focus order which follows
widget which has currently the focus.

The focus order first goes to the next child, then to
the children of the child recursively and then to the
next sibling which is higher in the stacking order.  A
widget is omitted if it has the takefocus option set
to 0.tk_focusNextNr  r  s     r   r  Misc.tk_focusNext=  s2     ww||NDGG4D!!$''r   c                     U R                   R                  SU R                  5      nU(       d  gU R                  U5      $ )zHReturn previous widget in the focus order. See tk_focusNext for details.tk_focusPrevNr  r  s     r   r  Misc.tk_focusPrevJ  s0    ww||NDGG4D!!$''r   c                 0  ^ ^^^ Tc  T R                   R                  SU5        gUUUU 4S jn TR                  Ul        T R                  U5      mT R                   R                  SUT5      $ ! [         a    [	        T5      R                  Ul         NTf = f)zCall function once after given time.

MS specifies the time in milliseconds. FUNC gives the
function which shall be called. Additional parameters
are given as parameters to the function call.  Return
identifier to cancel scheduling with after_cancel.Nafterc                     >  T" T 6    TR                  T5        g ! [         a     g f = f!  TR                  T5        f ! [         a     f f = f= fr+  )r  r   )r  funcr   rO   s   r   callitMisc.after.<locals>.callit\  sY    $K**40# **40# s5   +  
((A?A
A	AAA)r<   r  rR   r*   r(   r4  )rO   msr  r  r  r   s   ` `` @r   r  
Misc.afterP  s     <GGLL"% 6"&-- >>&)D77<<T22	 " 6"&t*"5"56s   A. .$BBc                 *    U R                   " SU/UQ76 $ )z~Call FUNC once if the Tcl main loop has no event to
process.

Return an identifier to cancel the scheduling with
after_cancel.idle)r  )rO   r  r  s      r   
after_idleMisc.after_idlel  s     zz&$...r   c                    U(       d  [        S5      e U R                  R                  SSU5      nU R                  R                  U5      S   nU R	                  U5        U R                  R                  SSU5        g! [
         a     N*f = f)zCancel scheduling of function identified with ID.

Identifier returned by after or after_idle must be
given as first parameter.
z?id must be a valid identifier returned from after or after_idler  r
  r   cancelN)r  r<   r  r8   r  r   )rO   r.  datascripts       r   after_cancelMisc.after_cancelt  s      3 4 4	77<<4DWW&&t,Q/Fv& 	Wh+  		s   AA> >
B
Bc                 n    U R                   R                  U R                   R                  SSU5      5      $ )a  Return information about existing event handlers.

With no argument, return a tuple of the identifiers for all existing
event handlers created by the after and after_idle commands for this
interpreter.  If id is supplied, it specifies an existing handler; id
must have been the return value from some previous call to after or
after_idle and it must not have triggered yet or been canceled. If the
id doesn't exist, a TclError is raised.  Otherwise, the return value is
a tuple containing (script, type) where script is a reference to the
function to be called by the event handler and type is either 'idle'
or 'timer' to indicate what kind of event handler it is.
r  r
  r<   r8   r  )rO   r.  s     r   
after_infoMisc.after_info  s*     ww  gvr!BCCr   c                 ^    U R                   R                  SU R                  U5      -   5        g)zRing a display's bell.)bellN)r<   r  
_displayofrO   	displayofs     r   r  	Misc.bell  s     Y!;;<r   c                 Z    U R                   R                  SSSU R                  SU-   5      $ )zReturn the value of busy configuration option.

The widget must have been previously made busy by
tk_busy_hold().  Option may have any of the values accepted by
tk_busy_hold().
r<   busycgetr7   r  rO   options     r   tk_busy_cgetMisc.tk_busy_cget  s'     ww||D&&$''3v:FFr   c                 r   U(       a  [        X45      nOU(       a  [        U5      nUc  U R                  SSSU R                  5      $ [        U[        5      (       a"  U R                  SSSU R                  SU-   5      $ U R                  R                  " SSSU R                  /U R                  U5      Q76   g)a  Query or modify the busy configuration options.

The widget must have been previously made busy by
tk_busy_hold().  Options may have any of the values accepted by
tk_busy_hold().

Please note that the option database is referenced by the widget
name or class.  For example, if a Frame widget with name "frame"
is to be made busy, the busy cursor can be specified for it by
either call:

    w.option_add('*frame.busyCursor', 'gumby')
    w.option_add('*Frame.BusyCursor', 'gumby')
Nr<   r  	configurer7   )	r4   _getconfigurer  r   r   _getconfigure1r<   r  _optionsrO   r/   r  s      r   tk_busy_configureMisc.tk_busy_configure  s     SI&CC.C;%%fk477< <c3&&fk477CGE ET6;M$--:LMr   c                     U R                   R                  U R                   R                  SSSU5      5       Vs/ s H  o R                  U5      PM     sn$ s  snf )zReturn a list of widgets that are currently busy.

If a pattern is given, only busy widgets whose path names match
a pattern are returned.
r<   r  current)r<   r8   r  r  )rO   patternr   s      r   tk_busy_currentMisc.tk_busy_current  s]     !!$'',,G#5 676 +,""1%67 	7 7s   Ac                 T    U R                   R                  SSSU R                  5        g)zTMake this widget no longer busy.

User events will again be received by the widget.
r<   r  forgetNr  rN   s    r   tk_busy_forgetMisc.tk_busy_forget  s    
 	T68TWW5r   c                 v    U R                   R                  " SSSU R                  /U R                  U5      Q76   g)a  Make this widget appear busy.

The specified widget and its descendants will be blocked from
user interactions.  Normally update() should be called
immediately afterward to insure that the hold operation is in
effect before the application starts its processing.

The only supported configuration option is:

    cursor: the cursor to be displayed when the widget is made
            busy.
r<   r  holdNr<   r  r  r  rO   r  s     r   tk_busy_holdMisc.tk_busy_hold  s,     	T66477GT]]25FGr   c                     U R                   R                  U R                   R                  SSSU R                  5      5      $ )z3Return True if the widget is busy, False otherwise.r<   r  statusr<   r  r  r  rN   s    r   tk_busy_statusMisc.tk_busy_status  s5    ww!!$'',,fh#1 2 	2r   c                    SU;  aC  U R                   S:X  a3   SUS'   U R                  R                  SU R                  U5      -   5      $ U R                  R                  SU R                  U5      -   5      $ ! [         a    US	  N<f = f)a  Retrieve data from the clipboard on window's display.

The window keyword defaults to the root window of the Tkinter
application.

The type keyword specifies the form in which the data is
to be returned and should be an atom name such as STRING
or FILE_NAME.  Type defaults to STRING, except on X11, where the default
is to try UTF8_STRING and fall back to STRING.

This command is equivalent to:

selection_get(CLIPBOARD)
r(   x11UTF8_STRING)	clipboardr(  )_windowingsystemr<   r  r  r   r  s     r   clipboard_getMisc.clipboard_get  s      5 5 >*6
ww||$84==;L$LMM ww||04==3DDEE  vJs   1A7 7BBc                     SU;  a  U R                   US'   U R                  R                  SU R                  U5      -   5        g)zClear the data in the Tk clipboard.

A widget specified for the optional displayof keyword
argument specifies the target display.r  )r  clearNr  r<   r  r  r  s     r   clipboard_clearMisc.clipboard_clear  s7    
 b DGG"[/+dmmB.??@r   c                     SU;  a  U R                   US'   U R                  R                  SU R                  U5      -   SU4-   5        g)zAppend STRING to the Tk clipboard.

A widget specified at the optional displayof keyword
argument specifies the target display. The clipboard
can be retrieved with selection_get.r  )r  r   --Nr  )rO   stringr  s      r   clipboard_appendMisc.clipboard_append  sE     b DGG"[/,t}}R/@@v 	 r   c                     U R                   R                  SSU R                  5      nU(       d  gU R                  U5      $ )zGReturn widget which has currently the grab in this application
or None.grabr  Nr  r  s     r   grab_currentMisc.grab_current  s4     ww||FItww7D!!$''r   c                 R    U R                   R                  SSU R                  5        g)z.Release grab for this widget if currently set.r  releaseNr  rN   s    r   grab_releaseMisc.grab_release  s    VY0r   c                 R    U R                   R                  SSU R                  5        g)zgSet grab for this widget.

A grab directs all events to this and descendant
widgets in the application.r  r$  Nr  rN   s    r   grab_setMisc.grab_set  s    
 	VUDGG,r   c                 T    U R                   R                  SSSU R                  5        g)zSet global grab for this widget.

A global grab directs all events to this and
descendant widgets on the display. Use with caution -
other applications do not get events anymore.r  r$  z-globalNr  rN   s    r   grab_set_globalMisc.grab_set_global$  s     	VUItww7r   c                 d    U R                   R                  SSU R                  5      nUS:X  a  SnU$ )zQReturn None, "local" or "global" if this widget has
no, a local or a global grab.r  r  r  Nr  )rO   r  s     r   grab_statusMisc.grab_status,  s/     fh8VdVr   c                 @    U R                   R                  SSXU5        g)zSet a VALUE (second parameter) for an option
PATTERN (first parameter).

An optional third parameter gives the numeric priority
(defaults to 80).r  r8  Nr  )rO   r  r   prioritys       r   
option_addMisc.option_add3  s     	Xugh?r   c                 <    U R                   R                  SS5        g)zHClear the option database.

It will be reloaded if option_add is called.r  r  Nr  rN   s    r   option_clearMisc.option_clear;  s     	Xw'r   c                 R    U R                   R                  SSU R                  X5      $ )zwReturn the value for an option NAME for this widget
with CLASSNAME.

Values with higher priority override lower values.r  r(  r  )rO   r   	classNames      r   
option_getMisc.option_getA  s!    
 ww||HeTWWdFFr   c                 >    U R                   R                  SSX5        g)zfRead file FILENAME into the option database.

An optional second parameter gives the numeric
priority.r  readfileNr  )rO   fileNamer/  s      r   option_readfileMisc.option_readfileH  s    
 	Xz8>r   c                     SU;  a  U R                   US'   U R                  R                  SU R                  U5      -   5        g)zClear the current X selection.r  )	selectionr  Nr  r  s     r   selection_clearMisc.selection_clearO  s5    b DGG"[/+dmmB.??@r   c                 >   SU;  a  U R                   US'   SU;  aC  U R                  S:X  a3   SUS'   U R                  R                  SU R	                  U5      -   5      $ U R                  R                  SU R	                  U5      -   5      $ ! [
         a    US	  N<f = f)ae  Return the contents of the current X selection.

A keyword parameter selection specifies the name of
the selection and defaults to PRIMARY.  A keyword
parameter displayof specifies a widget on the display
to use. A keyword parameter type specifies the form of data to be
fetched, defaulting to STRING except on X11, where UTF8_STRING is tried
before STRING.r  r(   r  r  )r?  r(  )r  r  r<   r  r  r   r  s     r   selection_getMisc.selection_getT  s     b DGG"[/ 5 5 >*6
ww||$84==;L$LMM ww||04==3DDEE  vJs   1B BBc                     U R                  U5      nU R                  R                  SU R                  U5      -   U R                  U4-   5        g)a  Specify a function COMMAND to call if the X
selection owned by this widget is queried by another
application.

This function must return the contents of the
selection. The function will be called with the
arguments OFFSET and LENGTH which allows the chunking
of very long selections. The following keyword
parameters can be provided:
selection - name of the selection (default PRIMARY),
type - type of the selection (e.g. STRING, FILE_NAME).)r?  handleN)r4  r<   r  r  r  )rO   commandr  r   s       r   selection_handleMisc.selection_handlef  sC     ~~g&,t}}R/@@$  	!r   c                 z    U R                   R                  SU R                  U5      -   U R                  4-   5        g)zrBecome owner of X selection.

A keyword parameter selection specifies the name of
the selection (default PRIMARY).r?  ownN)r<   r  r  r  r  s     r   selection_ownMisc.selection_ownv  s6    
 	)r"#&*ggZ0 	1r   c                     SU;  a  U R                   US'   U R                  R                  SU R                  U5      -   5      nU(       d  gU R	                  U5      $ )zReturn owner of X selection.

The following keyword parameter can
be provided:
selection - name of the selection (default PRIMARY),
type - type of the selection (e.g. STRING, FILE_NAME).r  rK  N)r  r<   r  r  r  )rO   r  r   s      r   selection_own_getMisc.selection_own_get~  sO     b DGG"[/ww||04==3DDED!!$''r   c                 B    U R                   R                  SX4U-   5      $ )zDSend Tcl command CMD to different interpreter INTERP to be executed.sendr  )rO   interpcmdr  s       r   rS  	Misc.send  s    ww||VV1D899r   c                 R    U R                   R                  SU R                  U5        g)z(Lower this widget in the stacking order.lowerNr  )rO   	belowThiss     r   rX  
Misc.lower      Wdggy1r   c                 R    U R                   R                  SU R                  U5        g)z(Raise this widget in the stacking order.raiseNr  )rO   	aboveThiss     r   tkraiseMisc.tkraise  r[  r   c                 P    U R                   R                  SS5      n[        U5      $ )z-Returns the exact version of the Tcl library.r
  
patchlevel)r<   r  rb   )rO   rb  s     r   info_patchlevelMisc.info_patchlevel  s!    WW\\&,7
j))r   c                     SU R                  U5      -   U4-   nU R                  R                  U R                  R                  U5      5      $ )z*Return integer which represents atom NAME.)winfoatom)r  r<   ri  r  )rO   r   r  r  s       r   
winfo_atomMisc.winfo_atom  s<     4??9#==Gww~~dggll4011r   c                 h    SU R                  U5      -   U4-   nU R                  R                  U5      $ )z'Return name of atom with identifier ID.)rf  atomname)r  r<   r  rO   r.  r  r  s       r   winfo_atomnameMisc.winfo_atomname  s5    $+,/1e4ww||D!!r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )z7Return number of cells in the colormap for this widget.rf  cellsr<   ri  r  r  rN   s    r   winfo_cellsMisc.winfo_cells  /    ww~~GGLL'47735 	5r   c                     / nU R                   R                  U R                   R                  SSU R                  5      5       H$  n UR	                  U R                  U5      5        M&     U$ ! [         a     M7  f = f)z?Return a list of all widgets which are children of this widget.rf  children)r<   r8   r  r  r   r  KeyError)rO   resultchilds      r   winfo_childrenMisc.winfo_children  sq    WW&&GGLL*dgg68E d00788   s    A--
A;:A;c                 P    U R                   R                  SSU R                  5      $ )z(Return window class name of this widget.rf  classr  rN   s    r   winfo_classMisc.winfo_class  s    ww||GWdgg66r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )z?Return True if at the last color request the colormap was full.rf  colormapfullr	  rN   s    r   winfo_colormapfullMisc.winfo_colormapfull  s1    ww!!GGLL.$'':< 	<r   c                     SU R                  U5      -   X4-   nU R                  R                  U5      nU(       d  gU R                  U5      $ )z@Return the widget which is at the root coordinates ROOTX, ROOTY.)rf  
containingN)r  r<   r  r  )rO   rootXrootYr  r  r   s         r   winfo_containingMisc.winfo_containing  sJ    &+,/4n=ww||D!D!!$''r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )z$Return the number of bits per pixel.rf  depthrq  rN   s    r   winfo_depthMisc.winfo_depth  s*    ww~~dggll7GTWWEFFr   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )z"Return true if this widget exists.rf  r  rq  rN   s    r   winfo_existsMisc.winfo_exists  /    ww~~GGLL(DGG46 	6r   c                     U R                   R                  U R                   R                  SSU R                  U5      5      $ )zOReturn the number of pixels for the given distance NUMBER
(e.g. "3c") as float.rf  fpixelsr<   rj  r  r  rO   numbers     r   winfo_fpixelsMisc.winfo_fpixels  s7     ww  Y"1 2 	2r   c                 P    U R                   R                  SSU R                  5      $ )zFReturn geometry string for this widget in the form "widthxheight+X+Y".rf  geometryr  rN   s    r   winfo_geometryMisc.winfo_geometry      ww||GZ99r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zReturn height of this widget.rf  r   rq  rN   s    r   winfo_heightMisc.winfo_height  r  r   c                 d    [        U R                  R                  SSU R                  5      S5      $ )z%Return identifier ID for this widget.rf  r.  r   )r_   r<   r  r  rN   s    r   winfo_idMisc.winfo_id  s$    477<<tww7;;r   c                     SU R                  U5      -   nU R                  R                  U R                  R                  U5      5      $ )z9Return the name of all Tcl interpreters for this display.)rf  interps)r  r<   r8   r  )rO   r  r  s      r   winfo_interpsMisc.winfo_interps  s7    #dooi&@@ww  d!344r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )z%Return true if this widget is mapped.rf  ismappedrq  rN   s    r   winfo_ismappedMisc.winfo_ismapped  /    ww~~GGLL*dgg68 	8r   c                 P    U R                   R                  SSU R                  5      $ )z/Return the window manager name for this widget.rf  managerr  rN   s    r   winfo_managerMisc.winfo_manager  s    ww||GY88r   c                 P    U R                   R                  SSU R                  5      $ )zReturn the name of this widget.rf  r   r  rN   s    r   
winfo_nameMisc.winfo_name  s    ww||GVTWW55r   c                 P    U R                   R                  SSU R                  5      $ )z-Return the name of the parent of this widget.rf  parentr  rN   s    r   winfo_parentMisc.winfo_parent      ww||GXtww77r   c                     [        U[        5      (       a  [        U5      nSU R                  U5      -   U4-   nU R                  R                  U5      $ )z.Return the pathname of the widget given by ID.)rf  pathname)r   r_   r   r  r<   r  rl  s       r   winfo_pathnameMisc.winfo_pathname  sK    b#RB$+,/1e4ww||D!!r   c                     U R                   R                  U R                   R                  SSU R                  U5      5      $ )z'Rounded integer value of winfo_fpixels.rf  pixelsrq  r  s     r   winfo_pixelsMisc.winfo_pixels  s1    ww~~GGLL(DGGV<> 	>r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )z:Return the x coordinate of the pointer on the root window.rf  pointerxrq  rN   s    r   winfo_pointerxMisc.winfo_pointerx
  r  r   c                 n    U R                  U R                  R                  SSU R                  5      5      $ )zHReturn a tuple of x and y coordinates of the pointer on the root window.rf  	pointerxy_getintsr<   r  r  rN   s    r   winfo_pointerxyMisc.winfo_pointerxy  s+    }}GGLL+tww79 	9r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )z:Return the y coordinate of the pointer on the root window.rf  pointeryrq  rN   s    r   winfo_pointeryMisc.winfo_pointery  r  r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )z'Return requested height of this widget.rf  	reqheightrq  rN   s    r   winfo_reqheightMisc.winfo_reqheight  s/    ww~~GGLL+tww79 	9r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )z&Return requested width of this widget.rf  reqwidthrq  rN   s    r   winfo_reqwidthMisc.winfo_reqwidth  r  r   c                 p    U R                  U R                  R                  SSU R                  U5      5      $ )zNReturn a tuple of integer RGB values in range(65536) for color in this widget.rf  rgbr  )rO   colors     r   	winfo_rgbMisc.winfo_rgb#  s-    }}GGLL%%8: 	:r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zKReturn x coordinate of upper left corner of this widget on the
root window.rf  rootxrq  rN   s    r   winfo_rootxMisc.winfo_rootx(  1     ww~~GGLL'47735 	5r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zKReturn y coordinate of upper left corner of this widget on the
root window.rf  rootyrq  rN   s    r   winfo_rootyMisc.winfo_rooty.  r  r   c                 P    U R                   R                  SSU R                  5      $ )z&Return the screen name of this widget.rf  screenr  rN   s    r   winfo_screenMisc.winfo_screen4  r  r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zLReturn the number of the cells in the colormap of the screen
of this widget.rf  screencellsrq  rN   s    r   winfo_screencellsMisc.winfo_screencells8  1     ww~~GGLL-9; 	;r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zTReturn the number of bits per pixel of the root window of the
screen of this widget.rf  screendepthrq  rN   s    r   winfo_screendepthMisc.winfo_screendepth>  r  r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zPReturn the number of pixels of the height of the screen of this widget
in pixel.rf  screenheightrq  rN   s    r   winfo_screenheightMisc.winfo_screenheightD  s1     ww~~GGLL.$'':< 	<r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zMReturn the number of pixels of the height of the screen of
this widget in mm.rf  screenmmheightrq  rN   s    r   winfo_screenmmheightMisc.winfo_screenmmheightJ  s2     ww~~GGLL"2DGG<> 	>r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zLReturn the number of pixels of the width of the screen of
this widget in mm.rf  screenmmwidthrq  rN   s    r   winfo_screenmmwidthMisc.winfo_screenmmwidthP  s1     ww~~GGLL/477;= 	=r   c                 P    U R                   R                  SSU R                  5      $ )zReturn one of the strings directcolor, grayscale, pseudocolor,
staticcolor, staticgray, or truecolor for the default
colormodel of this screen.rf  screenvisualr  rN   s    r   winfo_screenvisualMisc.winfo_screenvisualV  s     ww||G^TWW==r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zOReturn the number of pixels of the width of the screen of
this widget in pixel.rf  screenwidthrq  rN   s    r   winfo_screenwidthMisc.winfo_screenwidth\  r  r   c                 P    U R                   R                  SSU R                  5      $ )zpReturn information of the X-Server of the screen of this widget in
the form "XmajorRminor vendor vendorVersion".rf  serverr  rN   s    r   winfo_serverMisc.winfo_serverb  s     ww||GXtww77r   c                 n    U R                  U R                  R                  SSU R                  5      5      $ )z*Return the toplevel widget of this widget.rf  toplevel)r  r<   r  r  rN   s    r   winfo_toplevelMisc.winfo_toplevelg  s/    !!$'',,Z#* + 	+r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zBReturn true if the widget and all its higher ancestors are mapped.rf  viewablerq  rN   s    r   winfo_viewableMisc.winfo_viewablel  r  r   c                 P    U R                   R                  SSU R                  5      $ )zReturn one of the strings directcolor, grayscale, pseudocolor,
staticcolor, staticgray, or truecolor for the
colormodel of this widget.rf  visualr  rN   s    r   winfo_visualMisc.winfo_visualq  s     ww||GXtww77r   c                 P    U R                   R                  SSU R                  5      $ )z7Return the X identifier for the visual for this widget.rf  visualidr  rN   s    r   winfo_visualidMisc.winfo_visualidw  r  r   c                 @   U R                   R                  SSU R                  U(       a  SOS5      nU R                   R                  U5       Vs/ s H  o0R                   R                  U5      PM     nnU Vs/ s H  o0R	                  U5      PM     sn$ s  snf s  snf )zReturn a list of all visuals available for the screen
of this widget.

Each item in the list consists of a visual name (see winfo_visual), a
depth and if includeids is true is given also the X identifier.rf  visualsavailable
includeidsN)r<   r  r  r8   _Misc__winfo_parseitem)rO   r  r  r   s       r   winfo_visualsavailableMisc.winfo_visualsavailable{  s     ww||G%7,6LDB.2gg.?.?.EF.E!!!$.EF3784a&&q)488 G8s   $B9Bc           	      R    USS [        [        U R                  USS 5      5      -   $ )r   Nr   )r   r	   _Misc__winfo_getint)rO   r?   s     r   __winfo_parseitemMisc.__winfo_parseitem  s+    !uuS!4!4ae<===r   c                     [        US5      $ )r   r   )r_   rQ  s     r   __winfo_getintMisc.__winfo_getint  s    1ayr   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zReturn the height of the virtual root window associated with this
widget in pixels. If there is no virtual root window return the
height of the screen.rf  vrootheightrq  rN   s    r   winfo_vrootheightMisc.winfo_vrootheight  s1     ww~~GGLL-9; 	;r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zReturn the width of the virtual root window associated with this
widget in pixel. If there is no virtual root window return the
width of the screen.rf  
vrootwidthrq  rN   s    r   winfo_vrootwidthMisc.winfo_vrootwidth  s1     ww~~GGLL,8: 	:r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zaReturn the x offset of the virtual root relative to the root
window of the screen of this widget.rf  vrootxrq  rN   s    r   winfo_vrootxMisc.winfo_vrootx  1     ww~~GGLL(DGG46 	6r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zaReturn the y offset of the virtual root relative to the root
window of the screen of this widget.rf  vrootyrq  rN   s    r   winfo_vrootyMisc.winfo_vrooty  r3  r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )z Return the width of this widget.rf  r   rq  rN   s    r   winfo_widthMisc.winfo_width  rt  r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zNReturn the x coordinate of the upper left corner of this widget
in the parent.rf  r   rq  rN   s    r   winfo_xMisc.winfo_x  1     ww~~GGLL#tww/1 	1r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zNReturn the y coordinate of the upper left corner of this widget
in the parent.rf  r   rq  rN   s    r   winfo_yMisc.winfo_y  r>  r   c                 :    U R                   R                  S5        g)zEEnter event loop until all pending events have been processed by Tcl.r)   Nr  rN   s    r   r)   Misc.update  s    Xr   c                 <    U R                   R                  SS5        g)zEnter event loop until all idle callbacks have been called. This
will update the display of windows but not process events caused by
the user.r)   	idletasksNr  rN   s    r   update_idletasksMisc.update_idletasks  s     	X{+r   c                     Uc?  U R                   R                  U R                   R                  SU R                  5      5      $ U R                   R                  SU R                  U5        g)a  Set or get the list of bindtags for this widget.

With no argument return the list of all bindtags associated with
this widget. With a list of strings as argument the bindtags are
set to this list. The bindtags determine in which order events are
processed (see bind).Nbindtagsr<   r8   r  r  )rO   tagLists     r   rI  Misc.bindtags  sP     ?77$$Z13 3 GGLLTWWg6r   c                    [        U[        5      (       a   U R                  R                  XU4-   5        gU(       ag  U R	                  X0R
                  U5      nU=(       a    S=(       d    S< SU< SU R                  < S3nU R                  R                  XU4-   5        U$ U(       a  U R                  R                  X4-   5      $ U R                  R                  U R                  R                  U5      5      $ )r   +r   if {"[r   z]" == "break"} break
N)r   r   r<   r  r4  _substitute_subst_format_strr8   )rO   r   sequencer  r8  needcleanupfuncidrU  s           r   _bind
Misc._bind  s    dC  GGLL4 001^^D*:*:#%F KC%2%..0C GGLL3/0M77<<{ 23377$$TWW\\$%788r   c                 @    U R                  SU R                  4XU5      $ )aW  Bind to this widget at event SEQUENCE a call to function FUNC.

SEQUENCE is a string of concatenated event
patterns. An event pattern is of the form
<MODIFIER-MODIFIER-TYPE-DETAIL> where MODIFIER is one
of Control, Mod2, M2, Shift, Mod3, M3, Lock, Mod4, M4,
Button1, B1, Mod5, M5 Button2, B2, Meta, M, Button3,
B3, Alt, Button4, B4, Double, Button5, B5 Triple,
Mod1, M1. TYPE is one of Activate, Enter, Map,
ButtonPress, Button, Expose, Motion, ButtonRelease
FocusIn, MouseWheel, Circulate, FocusOut, Property,
Colormap, Gravity Reparent, Configure, KeyPress, Key,
Unmap, Deactivate, KeyRelease Visibility, Destroy,
Leave and DETAIL is the button number for ButtonPress,
ButtonRelease and DETAIL is the Keysym for KeyPress and
KeyRelease. Examples are
<Control-Button-1> for pressing Control and mouse button 1 or
<Alt-A> for pressing A and the Alt key (KeyPress can be omitted).
An event pattern can also be a virtual event of the form
<<AString>> where AString can be arbitrary. This
event can be generated by event_generate.
If events are concatenated they must appear shortly
after each other.

FUNC will be called if the event sequence occurs with an
instance of Event as argument. If the return value of FUNC is
"break" no further bound function is invoked.

An additional boolean parameter ADD specifies whether FUNC will
be called additionally to the other bound function or whether
it will replace the previous function.

Bind will return an identifier to allow deletion of the bound function with
unbind without memory leak.

If FUNC or SEQUENCE is omitted the bound function or list
of bound events are returned.bindrU  r  rO   rR  r  r8  s       r   rX  	Misc.bind  s!    N zz6477+XSAAr   c                 B    U R                  SU R                  U4U5        g)zUnbind for this widget the event SEQUENCE.

If FUNCID is given, only unbind the function identified with FUNCID
and also delete the corresponding Tcl command.

Otherwise destroy the current binding for SEQUENCE, leaving SEQUENCE
unbound.
rX  N_unbindr  )rO   rR  rT  s      r   unbindMisc.unbind  s     	fdggx0&9r   c                 l  ^ Uc  U R                   R                  " / UQSP76   g U R                   R                  U5      R                  S5      nSU S3mSR                  U4S jU 5       5      nUR	                  5       (       d  SnU R                   R                  " / UQUP76   U R                  U5        g )Nr   r   rO  r   c              3   X   >#    U  H  nUR                  T5      (       a  M  Uv   M!     g 7fr+  )
startswith)r   lineprefixs     r   r   Misc._unbind.<locals>.<genexpr>  s$      =ed$(OOF$; "Tes   *	*)r<   r  splitr   stripr  )rO   r   rT  lineskeepre  s        @r   r^  Misc._unbind  s    >GGLL#$##GGLL&,,T2Evha(F99 =e = =D::<<GGLL%$%%v&r   c                 F    U R                  5       R                  SXUS5      $ )a  Bind to all widgets at an event SEQUENCE a call to function FUNC.
An additional boolean parameter ADD specifies whether FUNC will
be called additionally to the other bound function or whether
it will replace the previous function. See bind for the return value.)rX  allTr  rU  rZ  s       r   bind_allMisc.bind_all#  s!    
 zz|!!/83MMr   c                 H    U R                  5       R                  SSU45        g)z8Unbind for all widgets for event SEQUENCE all functions.rX  rm  Nr  r^  )rO   rR  s     r   
unbind_allMisc.unbind_all*  s    

feX67r   c                 J    U R                  5       R                  SU4X#US5      $ )a  Bind to widgets with bindtag CLASSNAME at event
SEQUENCE a call of function FUNC. An additional
boolean parameter ADD specifies whether FUNC will be
called additionally to the other bound function or
whether it will replace the previous function. See bind for
the return value.rX  Trn  )rO   r6  rR  r  r8  s        r   
bind_classMisc.bind_class.  s&     zz|!!69"5xsDQQr   c                 F    U R                  5       R                  SX45        g)zOUnbind for all widgets with bindtag CLASSNAME for event SEQUENCE
all functions.rX  Nrr  )rO   r6  rR  s      r   unbind_classMisc.unbind_class8  s     	

fi:;r   c                 :    U R                   R                  U5        g)zCall the mainloop of Tk.N)r<   r|  )rO   r   s     r   r|  Misc.mainloop=  s    r   c                 8    U R                   R                  5         g)z8Quit the Tcl interpreter. All widgets will be destroyed.N)r<   quitrN   s    r   r~  	Misc.quitA  s    r   c                     U(       aB  [        [        U R                  R                  U R                  R	                  U5      5      5      $ gr   )r   r	   r<   ri  r8   rO   r  s     r   r  Misc._getintsE  s3    TWW^^TWW->->v-FGHH r   c                     U(       aB  [        [        U R                  R                  U R                  R	                  U5      5      5      $ gr   )r   r	   r<   rj  r8   r  s     r   _getdoublesMisc._getdoublesJ  s5    TWW..0A0A&0IJKK r   c                 H    U(       a  U R                   R                  U5      $ gr   )r<   r  r  s     r   _getbooleanMisc._getbooleanO  s    77%%f-- r   c                 <    U(       a  SU4$ Uc  SU R                   4$ g)r   r  r!   r  r  s     r   r  Misc._displayofT  s(     ),, $''**r   c                      U R                  5       R                  $ ! [         a5    U R                  R	                  SS5      =oR                  5       l        Us $ f = f)r   r<   windowingsystem)r  _windowingsystem_cachedr*   r<   r  )rO   wss     r   r  Misc._windowingsystem\  sP    	::<777 	T+<=>B5I	s    <AAc                 *   U(       a  [        X45      nO[        U5      nSnUR                  5        H  u  pEUc  M
  US   S:X  a  USS n[        U5      (       a  U R                  U5      nO[	        U[
        [        45      (       a~  / nU He  n[	        U[        5      (       a  UR                  [        U5      5        M4  [	        U[        5      (       a  UR                  [        U5      5        Me    O   SR                  U5      nUSU-   U4-   nM     U$ )r   r!   N_r   r7   )r4   r-   callabler4  r   r   r   r_   r   r   r
   r   )rO   r/   r  r$   r2   r3   nvr%   s           r   r  Misc._optionsf  s    SI&CC.CIIKDA}R5C<QsVA;;q)AE4=11B !%dC00IIc$i0'c22IIj&67! !"  HHRLSUAJ&!  " 
r   c                     [        U5      R                  S5      nU nUS   (       d  UR                  5       nUSS nU H  nU(       d    U$ UR                  U   nM     U$ )zHReturn the Tkinter instance of a widget identified by
its Tcl name NAME.rH   r   r   N)r   rg  r  rv  )rO   r   wr   s       r   nametowidgetMisc.nametowidget  se     4ys#Aw	A8DA  

1A 
 r   c                 t   [        XU 5      R                  n[        [        U5      5      n UR                  n XQR                  -   nU R                  R                  XT5        U(       a/  U R                  c  / U l	        U R                  R                  U5        U$ ! [
         a     Nnf = f! [
         a     Nof = f)zReturn a newly created Tcl function. If this
function is called, the Python function FUNC will
be executed. An optional function SUBST can
be given which will be executed before FUNC.)r,  r-  r   r.  r/  r*   rR   r<   r0  r  r   )rO   r  substrS  r2  r   s         r   r4  Misc._register  s    
 T*33BqE{	==D	--'D 	d&  ($&!$$T*  		  		s"   B B* 
B'&B'*
B76B7c                 X    U nUR                   b  UR                   oR                   b  M  U$ )r   r   )rO   r  s     r   r  
Misc._root  s%    hh"Ahh"r   )z%#z%bz%fz%hz%kz%sz%tz%wz%xz%yz%Az%Ez%Kz%Nz%Wz%Tz%Xz%Yz%Dr   c                   ^ [        U5      [        U R                  5      :w  a  U$ U R                  R                  nU R                  R                  mU4S jn[        S U 5       5      (       a;  U Vs/ s H.  n[        U[        5      (       a  [        U5      S:X  a  US   OUPM0     nnUu  pVpxppppnnnnnnn[        5       nT" U5      Ul	        U" U5      Ul
        U" U5      Ul        U" U5      Ul        U" U	5      Ul        U" U5      Ul        U" U
5      Ul        U" U5      Ul        U" U5      Ul        U" U5      Ul        UUl        U" U5      Ul        UUl        U" U5      Ul         [1        U5      Ul         U R9                  U5      Ul        U" U5      Ul        U" U5      Ul          T" U5      Ul!        U4$ s  snf ! [         a     Nf = f! [         a     Nf = f! [4         a5     [1        [7        U5      5      Ul         N! [4         a    UUl          Nf = ff = f! [<         a
    UUl         Nf = f! [4        [        4 a    SUl!         U4$ f = f)r   c                 F   >  T" U 5      $ ! [         [        4 a    U s $ f = f)z?Tk changed behavior in 8.4.2, returning "??" rather more often.)r  r   )r   ri  s    r   getint_event&Misc._substitute.<locals>.getint_event  s+    ay ) s      c              3   B   #    U  H  n[        U[        5      v   M     g 7fr+  )r   r   )r   r   s     r   r   #Misc._substitute.<locals>.<genexpr>  s     2Tz!U##Ts   r   r   )"r   _subst_formatr<   r  ri  anyr   r   r   rM   r   r   r   r   r   r   timer   r   r   r   r   r   
keysym_numrd   r(   r  r   r  widgetrw  x_rooty_rootr   )rO   r  r  r  r   nsignr[   r2  hr2   r?   r  r   r   AEKNWTXYDeri  s                           @r   rP  Misc._substitute  s<   t9D..//WW''
	 2T222!#! 'q%00SVq[AaDaG!  #FJC!aA!1aAq!G %=Q!!}QW? O	q/aq/1o1o&qMQ\#A	q\AF	))!,AH  ??	QiAG tg#*  
  	"3q6* 	  	AH	 H% 	AGt	sx   35GG G /G&  H( 1H? 
GG
G#"G#&
H%1HH!H% H!!H%(H<;H<?IIc                 x    [         R                  " 5       u  pnU R                  5       nUR                  XU5        gr   )sysexc_infor  report_callback_exception)rO   r  valtbr   s        r   _report_exceptionMisc._report_exception  s,    ||~"zz|&&s4r   c                     0 nU R                   R                  U R                   R                  " U6 5       H5  nU R                   R                  U5      nUS   SS 4USS -   X#S   SS '   M7     U$ )z;Call Tcl configure command and return the result as a dict.r   r   Nr  )rO   r  r/   r   s       r   r  Misc._getconfigure  sp    ""477<<#67A!!!$AqT!"XK!AB%/C!QRM 8 
r   c                     U R                   R                  U R                   R                  " U6 5      nUS   SS  4USS  -   $ )Nr   r   r  rO   r  r   s      r   r  Misc._getconfigure1  s@    GGdggllD12!QR{QqrU""r   c                    U(       a  [        X#45      nOU(       a  [        U5      nUc&  U R                  [        U R                  U45      5      $ [	        U[
        5      (       a*  U R                  [        U R                  USU-   45      5      $ U R                  R                  [        U R                  U45      U R                  U5      -   5        g)r   Nr7   )
r4   r  r"   r  r   r   r  r<   r  r  )rO   rU  r/   r  s       r   
_configureMisc._configure
  s    SI&CC.C;%%h~&>??c3&&x#s3w0G'HIIXtwwn-c0BBCr   c                 &    U R                  SX5      $ )a  Query or modify the configuration options of the widget.

If no arguments are specified, return a dictionary describing
all of the available options for the widget.

If an option name is specified, then return a tuple describing
the one named option.

If one or more keyword arguments are specified or a dictionary
is specified, then modify the widget option(s) to have the given
value(s).
r  r  r  s      r   r  Misc.configure  s     {C44r   c                 V    U R                   R                  U R                  SSU-   5      $ )z5Return the current value of the configuration option.r  r7   r  rO   rA   s     r   r  	Misc.cget(  s!    ww||DGGVS3Y77r   c                 (    U R                  X05        g r+  )r  rO   rA   r   s      r   __setitem__Misc.__setitem__.  s    |$r   c                     U R                   R                  nU" U R                   R                  U R                  S5      5       Vs/ s H  o!" U5      S   SS PM     sn$ s  snf )z1Return a list of all option names of this widget.r  r   r   NrJ  )rO   r8   r   s      r   r   	Misc.keys1  s]    GG%%	$'',,tww<=?= )*	!Q#=? 	? ?s   Ac                     U R                   $ )z+Return the window path name of this widget.r  rN   s    r   rP   Misc.__str__7  s    wwr   c                     SU R                   R                  < SU R                   R                  < SU R                  < S3$ )Nr   rH   z object r   )rV  rS   rT   r  rN   s    r   r   Misc.__repr__;  s-    NN%%t~~'B'BDGGM 	Mr   _noarg_c                     U[         R                  L a6  U R                  U R                  R	                  SSU R
                  5      5      $ U R                  R	                  SSU R
                  U5        g)zSet or get the status for propagation of geometry information.

A boolean argument specifies whether the geometry information
of the slaves will determine the size of this widget. If no argument
is given the current setting will be returned.
pack	propagateNr  r  r  r<   r  r  rO   flags     r   pack_propagateMisc.pack_propagateB  Y     4<<##DGGLLTWW%. / / GGLLdggt<r   c                     U R                   R                  U R                   R                  SSU R                  5      5       Vs/ s H  oR	                  U5      PM     sn$ s  snf )@Return a list of all slaves of this widget
in its packing order.r  slavesr<   r8   r  r  r  rQ  s     r   pack_slavesMisc.pack_slavesQ  s]     !!77<<$'':<=< +,""1%<= 	= =   A c                     U R                   R                  U R                   R                  SSU R                  5      5       Vs/ s H  oR	                  U5      PM     sn$ s  snf )r  placer  r  rQ  s     r   place_slavesMisc.place_slaves[  s`     !!77<<$''3454 +,""1%45 	5 5r  c                 T    U R                   R                  SSU R                  U5        g)zThe anchor value controls how to place the grid within the
master when no row/column has any weight.

The default anchor is nw.gridanchorNr  )rO   r  s     r   grid_anchorMisc.grid_anchore  s    
 	VXtww7r   c                     SSU R                   4nUb	  Ub  XQU4-   nUb	  Ub  XSU4-   nU R                  U R                  R                  " U6 5      =(       d    S$ )a  Return a tuple of integer coordinates for the bounding
box of this widget controlled by the geometry manager grid.

If COLUMN, ROW is given the bounding box applies from
the cell with row and column 0 to the specified
cell. If COL2 and ROW2 are given the bounding box
starts at that cell.

The returned integers specify the offset of the upper left
corner in the master widget and the width and height.
r  bboxN)r  r  r<   r  )rO   columnrowcol2row2r  s         r   	grid_bboxMisc.grid_bboxn  sb     (#/3-'D 0,&D}}TWW\\4019T9r   c                    [        U[        [        R                  45      (       aP   [        U5      nU(       d  g SU;   a  U R                  R                  U5      $ U R                  R                  U5      $ U$ ! [        [        4 a     U$ f = f)NrH   )	r   r   _tkinterTcl_Objr<   rj  ri  r  r   )rO   r   svalues      r   _gridconvvalueMisc._gridconvvalue  s    ec8#3#3455	UF]77,,V4477>>&11  ) s   A8  A8 A8 8BBc           	         [        U[        5      (       a'  U(       d   USS S:X  a  USS nUSS S:w  a  SU-   nU4nOU R                  X45      nU(       dD  [        U R                  U R                  R                  SXR                  U5      U R                  S9$ U R                  R                  SXR                  U4U-   5      n[        U5      S:X  a  U R                  U5      $ g)r   r  Nr  r   r7   r  )r>   )	r   r   r  rB   r<   r  r  r   r   )rO   rG  indexr/   r  optionsr$   s          r   _grid_configureMisc._grid_configure  s    c323x3#2h2Aw#~#gfGmmC,GVWggu=((* * ggll7GGU3 w<1&&s++ r   c                 (    U R                  SXU5      $ )zConfigure column INDEX of a grid.

Valid options are minsize (minimum size of the column),
weight (how much does additional space propagate to this column)
and pad (how much space to let additionally).columnconfigurer  rO   r  r/   r  s       r   grid_columnconfigureMisc.grid_columnconfigure  s     ##$5u2FFr   c           	          U R                  U R                  R                  SSU R                  X5      5      =(       d    S$ )zReturn a tuple of column and row which identify the cell
at which the pixel at position X and Y inside the master
widget is located.r  locationNr  rO   r   r   s      r   grid_locationMisc.grid_location  s:     }}GGLL
DGGQ34 <7;	<r   c                     U[         R                  L a6  U R                  U R                  R	                  SSU R
                  5      5      $ U R                  R	                  SSU R
                  U5        g)zSet or get the status for propagation of geometry information.

A boolean argument specifies whether the geometry information
of the slaves will determine the size of this widget. If no argument
is given, the current setting will be returned.
r  r  Nr  r  s     r   grid_propagateMisc.grid_propagate  r  r   c                 (    U R                  SXU5      $ )zConfigure row INDEX of a grid.

Valid options are minsize (minimum size of the row),
weight (how much does additional space propagate to this row)
and pad (how much space to let additionally).rowconfigurer	  r
  s       r   grid_rowconfigureMisc.grid_rowconfigure  s     ##NECCr   c                     U R                  U R                  R                  SSU R                  5      5      =(       d    S$ )z<Return a tuple of the number of column and rows in the grid.r  sizeNr  rN   s    r   	grid_sizeMisc.grid_size  s3    }}GGLL13 ;6:	;r   c                     SnUb  USU4-   nUb  USU4-   nU R                   R                  U R                   R                  SSU R                  4U-   5      5       Vs/ s H  o@R	                  U5      PM     sn$ s  snf )r  r!   z-rowz-columnr  r  r  )rO   r  r  r  r   s        r   grid_slavesMisc.grid_slaves  s     ?63-'D9f--D!!$'',,Hdgg.5#7 898 +,""1%89 	9 9s   A:c                 J    SSU4U-   nU R                   R                  U5        g)zBind a virtual event VIRTUAL (of the form <<Name>>)
to an event SEQUENCE such that the virtual event is triggered
whenever SEQUENCE occurs.eventr8  Nr  rO   virtual	sequencesr  s       r   	event_addMisc.event_add  s%     (94Tr   c                 J    SSU4U-   nU R                   R                  U5        g)z-Unbind a virtual event VIRTUAL from SEQUENCE.r!  deleteNr  r"  s       r   event_deleteMisc.event_delete  s#    7+i7Tr   c                     SSU R                   U4nUR                  5        H  u  pEUSU-  [        U5      4-   nM     U R                  R	                  U5        g)zrGenerate an event SEQUENCE. Additional
keyword arguments specify parameter of the event
(e.g. x, y, rootx, rooty).r!  generate-%sN)r  r-   r   r<   r  )rO   rR  r  r  r2   r3   s         r   event_generateMisc.event_generate  sO     TWWh7HHJDA519c!f--D Tr   c                 n    U R                   R                  U R                   R                  SSU5      5      $ )zmReturn a list of all virtual events or the information
about the SEQUENCE bound to the virtual event VIRTUAL.r!  r
  r  )rO   r#  s     r   
event_infoMisc.event_info  s/     ww  GGLL&'24 	4r   c                 l    U R                   R                  U R                   R                  SS5      5      $ )z*Return a list of all existing image names.imagenamesr  rN   s    r   image_namesMisc.image_names  &    ww  gw!?@@r   c                 l    U R                   R                  U R                   R                  SS5      5      $ )z?Return a list of all available image types (e.g. photo bitmap).r4  typesr  rN   s    r   image_typesMisc.image_types  r8  r   )r  r+  )r	  )r	  1r   F)r   rZ  )Nr   NNNNNN)rR   rS   rT   rU   r   _last_child_idsr  r   r  r  r  r  r  waitvarr  r  r  r  ri  rj  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  	busy_cgetr  busy_configbusy_configuretk_busy_configr  busy_currentr  busy_forgetr  r  	busy_holdtk_busyr
  busy_statusr  r  r  r  r#  r&  r)  r,  r0  r3  r7  r<  r@  rC  rH  rM  rP  rS  rX  r_  liftrc  rh  rm  rr  rz  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r!  r)  r-  r1  r6  r9  r<  r@  r)   rF  rI  rU  rX  r_  r^  ro  rs  rv  ry  r|  r~  r  r  r  r  propertyr  r  r  r  r4  registerr  r  r   rQ  rP  r  r  r  r  r  configr  __getitem__r  r   rP   r   r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r%  r)  r.  r1  r6  r;  rV   r!   r   r   r  r    s    E
 O L%/"=1 G48$$''A' E1	(((-
((38/,"D=G IN4 5FEKE.>7 #L6 !KH ".-D-9w2 !KF.A (1-8@(G?A
F$! 1
(:22 D*
2
"5
7<
(G6
2:6
<5
8
968">
8
9
8
9
8
:
558;;<>=>;8
+
8
8:	9>;:665
11,79$'BR	:'N8R<
I
L
.
  4" !M, H
CM /AF5#
D5 F8 K%?M
 kG") = I= F58 F:& D,* /1 G +O< #* = ,. D %L;
 D
9
4AAr   r  c                   $    \ rS rSrSrS rS rSrg)r,  i  zsInternal class. Stores function to call when some user
defined Tcl function is called e.g. after an event occurred.c                 (    Xl         X l        X0l        g)z(Store FUNC, SUBST and WIDGET as members.Nr  r  r  )rO   r  r  r  s       r   r  CallWrapper.__init__  s    	
r   c                      U R                   (       a  U R                   " U6 nU R                  " U6 $ ! [         a    e   U R                  R	                  5          g= f)z3Apply first function SUBST to arguments, than FUNC.N)r  r  r  r  r  rO   r  s     r   r-  CallWrapper.__call__  sM    	,zzzz4(99d## 		,KK))+s	   .1 &ArT  NrR   rS   rT   rU   r   r  r-  rV   r!   r   r   r,  r,    s    D	,r   r,  c                   *    \ rS rSrSrS rS rS rSrg)XViewi!  zTMix-in class for querying and changing the horizontal position
of a widget's window.c                     U R                   R                  " U R                  S/UQ76 nU(       d  U R                  U5      $ g)z5Query and change the horizontal position of the view.xviewNr<   r  r  r  rO   r  r$   s      r   r]  XView.xview%  8    ggll477G3d3##C(( r   c                 T    U R                   R                  U R                  SSU5        g)zkAdjusts the view in the window so that FRACTION of the
total width of the canvas is off-screen to the left.r]  movetoNr  rO   fractions     r   xview_movetoXView.xview_moveto+       	TWWgx:r   c                 T    U R                   R                  U R                  SSX5        g)zTShift the x-view according to NUMBER which is measured in "units"
or "pages" (WHAT).r]  scrollNr  rO   r  r   s      r   xview_scrollXView.xview_scroll0       	TWWgx>r   r!   N)	rR   rS   rT   rU   r   r]  rf  rl  rV   r!   r   r   r[  r[  !      );
?r   r[  c                   *    \ rS rSrSrS rS rS rSrg)YViewi6  zRMix-in class for querying and changing the vertical position
of a widget's window.c                     U R                   R                  " U R                  S/UQ76 nU(       d  U R                  U5      $ g)z3Query and change the vertical position of the view.yviewNr^  r_  s      r   rs  YView.yview:  ra  r   c                 T    U R                   R                  U R                  SSU5        g)zkAdjusts the view in the window so that FRACTION of the
total height of the canvas is off-screen to the top.rs  rc  Nr  rd  s     r   yview_movetoYView.yview_moveto@  rh  r   c                 T    U R                   R                  U R                  SSX5        g)zTShift the y-view according to NUMBER which is measured in
"units" or "pages" (WHAT).rs  rj  Nr  rk  s      r   yview_scrollYView.yview_scrollE  rn  r   r!   N)	rR   rS   rT   rU   r   rs  rv  ry  rV   r!   r   r   rq  rq  6  ro  r   rq  c                      \ rS rSrSr  S&S jr\rSS.S jr\rS'S jr	\	r
S	 r\rS'S
 jr\rS r\rS'S jr\rS r\rS r\rS'S jr\r  S&S jr\rS'S jr\rS(S jr\rS r\r S'S jr!\!r"S'S jr#\#r$S)S jr%\%r&S(S jr'\'r(S'S jr)\)r*S r+\+r,S(S jr-\-r.S(S jr/\/r0S'S jr1\1r2S'S jr3\3r4S(S jr5\5r6S(S jr7\7r8S'S  jr9\9r:S'S! jr;\;r<S'S" jr=\=r>S'S# jr?\?r@S$ rA\ArBS%rCg)*WmiK  zAProvides functions for the communication with the window manager.Nc                 r    U R                  U R                  R                  SSU R                  XX45      5      $ )zInstruct the window manager to set the aspect ratio (width/height)
of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM. Return a tuple
of the actual values if no argument is given.wmaspectr  )rO   minNumerminDenommaxNumermaxDenoms        r   	wm_aspectWm.wm_aspectN  s5     }}GGLLx)* 	*r   F)return_python_dictc                j   U(       d  U(       d_  U R                   R                  SSU R                  5      nU(       a  [        U R                   U5      $ U R                   R	                  U5      $ [        U5      S:X  aD  US   b>  US   nUS   S:X  a  USS nU R                   R                  SSU R                  SU-   5      $ U R                   R                  " SSU R                  /UQ76 $ U(       a  [        S5      eU R                   R                  " SSU R                  /U R                  U5      Q76   g)a  Return or sets platform specific attributes.

When called with a single argument return_python_dict=True,
return a dict of the platform specific attributes and their values.
When called without arguments or with a single argument
return_python_dict=False, return a tuple containing intermixed
attribute names with the minus prefix and their values.

When called with a single string value, return the value for the
specific option.  When called with keyword arguments, set the
corresponding attributes.
r~  
attributesr   r   Nr7   zNwm_attribute() options have been specified as positional and keyword arguments)r<   r  r  rB   r8   r   r+   r  )rO   r  r  kwargsr$   r  s         r   wm_attributesWm.wm_attributes[  s    ggll4tww?%%dggs3377,,S114yA~$q'"5a!9##ABZFww||D,vNN77<<lDGGCdCC ? @ @ GGLL|TWWMt}}V7LMr   c                 R    U R                   R                  SSU R                  U5      $ )zNStore NAME in WM_CLIENT_MACHINE property of this widget. Return
current value.r~  clientr  r  s     r   	wm_clientWm.wm_client  s!     ww||D(DGGT::r   c                 B   [        U5      S:  a  U4nSSU R                  4U-   nU(       a  U R                  R                  U5        gU R                  R	                  U R                  R                  U5      5       Vs/ s H  nU R                  U5      PM     sn$ s  snf )zStore list of window names (WLIST) into WM_COLORMAPWINDOWS property
of this widget. This list contains windows whose colormaps differ from their
parents. Return current list of widgets if WLIST is empty.r   r~  colormapwindowsN)r   r  r<   r  r8   r  )rO   wlistr  r   s       r   wm_colormapwindowsWm.wm_colormapwindows  s     u:>HE'1E9GGLL "WW..tww||D/ABDB &&q)BD D Ds   >Bc                 R    U R                   R                  SSU R                  U5      $ )zStore VALUE in WM_COMMAND property. It is the command
which shall be used to invoke the application. Return current
command if VALUE is None.r~  rG  r  r#  s     r   
wm_commandWm.wm_command  s!     ww||D)TWWe<<r   c                 P    U R                   R                  SSU R                  5      $ )zDeiconify this widget. If it was never mapped it will not be mapped.
On Windows it will raise this widget and give it the focus.r~  	deiconifyr  rN   s    r   wm_deiconifyWm.wm_deiconify  s     ww||D+tww77r   c                 R    U R                   R                  SSU R                  U5      $ )zSet focus model to MODEL. "active" means that this widget will claim
the focus itself, "passive" means that the window manager shall give
the focus. Return current focus model if MODEL is None.r~  
focusmodelr  )rO   models     r   wm_focusmodelWm.wm_focusmodel  s!     ww||D,??r   c                 >    U R                   R                  SSU5        g)a!  The window will be unmapped from the screen and will no longer
be managed by wm. toplevel windows will be treated like frame
windows once they are no longer managed by wm, however, the menu
option configuration will be remembered and the menus will return
once the widget is managed again.r~  r  Nr  r  s     r   	wm_forgetWm.wm_forget  s     	T8V,r   c                 P    U R                   R                  SSU R                  5      $ )zAReturn identifier for decorative frame of this widget if present.r~  framer  rN   s    r   wm_frameWm.wm_frame  s    ww||D'47733r   c                 R    U R                   R                  SSU R                  U5      $ )zaSet geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return
current value if None is given.r~  r  r  )rO   newGeometrys     r   wm_geometryWm.wm_geometry  s!     ww||D*dgg{CCr   c                 r    U R                  U R                  R                  SSU R                  XX45      5      $ )zInstruct the window manager that this widget shall only be
resized on grid boundaries. WIDTHINC and HEIGHTINC are the width and
height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are the
number of grid units requested in Tk_GeometryRequest.r~  r  r  )rO   	baseWidth
baseHeightwidthInc	heightIncs        r   wm_grid
Wm.wm_grid  s4     }}TWW\\&$''88 9 	9r   c                 R    U R                   R                  SSU R                  U5      $ )zvSet the group leader widgets for related widgets to PATHNAME. Return
the group leader of this widget if None is given.r~  groupr  rO   pathNames     r   wm_groupWm.wm_group  !     ww||D'477H==r   c                     Ub)  U R                   R                  SSU R                  SU5      $ U R                   R                  SSU R                  U5      $ )ao  Set bitmap for the iconified widget to BITMAP. Return
the bitmap if None is given.

Under Windows, the DEFAULT parameter can be used to set the icon
for the widget and any descendants that don't have an icon set
explicitly.  DEFAULT can be the relative path to a .ico file
(example: root.iconbitmap(default='myicon.ico') ).  See Tk
documentation for more information.r~  
iconbitmap-defaultr  )rO   bitmapdefaults      r   wm_iconbitmapWm.wm_iconbitmap  sF     77<<lDGGZQQ77<<lDGGVDDr   c                 P    U R                   R                  SSU R                  5      $ )zDisplay widget as icon.r~  iconifyr  rN   s    r   
wm_iconifyWm.wm_iconify  s    ww||D)TWW55r   c                 R    U R                   R                  SSU R                  U5      $ )zNSet mask for the icon bitmap of this widget. Return the
mask if None is given.r~  iconmaskr  )rO   r  s     r   wm_iconmaskWm.wm_iconmask  s!     ww||D*dggv>>r   c                 R    U R                   R                  SSU R                  U5      $ )zKSet the name of the icon for this widget. Return the name if
None is given.r~  iconnamer  )rO   newNames     r   wm_iconnameWm.wm_iconname  s!     ww||D*dggw??r   c                     U(       a+  U R                   R                  " SSU R                  S/UQ76   gU R                   R                  " SSU R                  /UQ76   g)a/  Sets the titlebar icon for this window based on the named photo
images passed through args. If default is True, this is applied to
all future created toplevels as well.

The data in the images is taken as a snapshot at the time of
invocation. If the images are later changed, this is not reflected
to the titlebar icons. Multiple images are accepted to allow
different images sizes to be provided. The window manager may scale
provided icons to an appropriate size.

On Windows, the images are packed into a Windows icon structure.
This will override an icon specified to wm_iconbitmap, and vice
versa.

On X, the images are arranged into the _NET_WM_ICON X property,
which most modern window managers support. An icon specified by
wm_iconbitmap may exist simultaneously.

On Macintosh, this currently does nothing.r~  	iconphotor  Nr  )rO   r  r  s      r   wm_iconphotoWm.wm_iconphoto  sC    ( GGLL{DGGZG$GGGLL{DGG;d;r   c           	      p    U R                  U R                  R                  SSU R                  X5      5      $ )zySet the position of the icon of this widget to X and Y. Return
a tuple of the current values of X and X if None is given.r~  iconpositionr  r  s      r   wm_iconpositionWm.wm_iconposition	  s1     }}TWW\\.$''11 2 	2r   c                 R    U R                   R                  SSU R                  U5      $ )z_Set widget PATHNAME to be displayed instead of icon. Return the current
value if None is given.r~  
iconwindowr  r  s     r   wm_iconwindowWm.wm_iconwindow	  s!     ww||D,BBr   c                 >    U R                   R                  SSU5        g)zThe widget specified will become a stand alone top-level window.
The window will be decorated with the window managers title bar,
etc.r~  manageNr  )rO   r  s     r   	wm_manageWm.wm_manage%	  s     	T8V,r   c           	      p    U R                  U R                  R                  SSU R                  X5      5      $ )zSet max WIDTH and HEIGHT for this widget. If the window is gridded
the values are given in grid units. Return the current values if None
is given.r~  maxsizer  rO   r   r   s      r   
wm_maxsizeWm.wm_maxsize-	  1     }}TWW\\)TWWe5 6 	6r   c           	      p    U R                  U R                  R                  SSU R                  X5      5      $ )zSet min WIDTH and HEIGHT for this widget. If the window is gridded
the values are given in grid units. Return the current values if None
is given.r~  minsizer  r  s      r   
wm_minsizeWm.wm_minsize6	  r  r   c                 p    U R                  U R                  R                  SSU R                  U5      5      $ )zxInstruct the window manager to ignore this widget
if BOOLEAN is given with 1. Return the current value if None
is given.r~  overrideredirect)r  r<   r  r  r  s     r   wm_overrideredirectWm.wm_overrideredirect?	  s4     $dggw!8 9 	9r   c                 R    U R                   R                  SSU R                  U5      $ )zInstruct the window manager that the position of this widget shall
be defined by the user if WHO is "user", and by its own policy if WHO is
"program".r~  positionfromr  rO   whos     r   wm_positionfromWm.wm_positionfromH	  s!     ww||D.$''3??r   c                     [        U5      (       a  U R                  U5      nOUnU R                  R                  SSU R                  X5      $ )zBind function FUNC to command NAME for this widget.
Return the function bound to NAME if None is given. NAME could be
e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW".r~  protocol)r  r4  r<   r  r  )rO   r   r  rG  s       r   wm_protocolWm.wm_protocolP	  sB     D>>nnT*GGww||*dggt6 	6r   c                 R    U R                   R                  SSU R                  X5      $ )zqInstruct the window manager whether this width can be resized
in WIDTH or HEIGHT. Both values are boolean values.r~  	resizabler  r  s      r   wm_resizableWm.wm_resizable]	  s!     ww||D+twwFFr   c                 R    U R                   R                  SSU R                  U5      $ )zInstruct the window manager that the size of this widget shall
be defined by the user if WHO is "user", and by its own policy if WHO is
"program".r~  sizefromr  r  s     r   wm_sizefromWm.wm_sizefromd	  s!     ww||D*dggs;;r   c                 R    U R                   R                  SSU R                  U5      $ )z~Query or set the state of this widget as one of normal, icon,
iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).r~  r   r  )rO   newstates     r   wm_stateWm.wm_statel	  r  r   c                 R    U R                   R                  SSU R                  U5      $ )zSet the title of this widget.r~  titler  r  s     r   wm_titleWm.wm_titles	  s    ww||D'477F;;r   c                 R    U R                   R                  SSU R                  U5      $ )zWInstruct the window manager that this widget is transient
with regard to widget MASTER.r~  	transientr  )rO   r   s     r   wm_transientWm.wm_transienty	  s!     ww||D+tww??r   c                 P    U R                   R                  SSU R                  5      $ )zWithdraw this widget from the screen such that it is unmapped
and forgotten by the window manager. Re-draw it with wm_deiconify.r~  r   r  rN   s    r   wm_withdrawWm.wm_withdraw	  s     ww||D*dgg66r   r!   r@  r+  rA  r?  )DrR   rS   rT   rU   r   r  r  r  r  r  r  r  r  r  rG  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r  r  r  r  r  r   rV   r!   r   r   r|  r|  K  s   K '+&*	* F6;  ND J;
 FD )O= G8
 I@ J- F4 ED
 H %)"&	9 D>
 EE J6 G?
 H@
 H<2 I2 #LC
 J- F6 G6 G9 +@ #L	6 HG
 I< H>
 E< E@
 I7
 Hr   r|  c                   N    \ rS rSrSrSr  SS jrS rS rS r	S	 r
S
 rS rSrg)r   i	  zvToplevel widget of Tk which represents mostly the main window
of an application. It has an associated Tcl interpreter.rH   Nc           
         SU l         0 U l        SU l        SU l        UcW  SSKnUR
                  R                  [        R                  S   5      nUR
                  R                  U5      u  p(US;  a  X(-   nSn	[        R                  " XX9[        XEU5      U l        [        (       a  U R                  R                  [        5        U(       a  U R!                  5         [        R"                  R$                  (       d  U R'                  X#5        gg)a!  Return a new top level widget on screen SCREENNAME. A new Tcl interpreter will
be created. BASENAME will be used for the identification of the profile file (see
readprofile).
It is constructed from sys.argv[0] without extensions if None is given. CLASSNAME
is the name of the widget class.NFr   )z.pyz.pyc)r   rv  	_tkloadedr<   ospathbasenamer  argvsplitextr  createwantobjects_debugsettrace_print_command_loadtkflagsignore_environmentreadprofile)
rO   
screenNamebaseNamer6  useTksyncuser  extinteractives
             r   r  Tk.__init__	  s      ww''4HGG,,X6MH/)#>//*	P[]bjmn6GG^,LLNyy++X1 ,r   c                 |    U R                   (       d+  U R                  R                  5         U R                  5         g g r+  )r  r<   loadtkr  rN   s    r   r'  	Tk.loadtk	  s%    ~~GGNNLLN r   c                    SU l         U R                  R                  S5      nU[        R                  :w  a"  [        S[        R                  < SU< S35      e[        U R                  R                  S5      5      nU[        R                  :w  a"  [        S[        R                  < SU< S35      eU R                  c  / U l        U R                  R                  S	[        5        U R                  R                  S
[        5        U R                  R                  S	5        U R                  R                  S
5        [        (       a	  [        c  U qU R                  SU R                   5        g )NT
tk_versionztk.h version (z!) doesn't match libtk.a version ()tcl_versionztcl.h version (z") doesn't match libtcl.a version (tkerrorexitWM_DELETE_WINDOW)r  r<   r  r  
TK_VERSIONr9   r   TCL_VERSIONr  r0  r   r  r   r   r   r  r   )rO   r*  r,  s      r   r  
Tk._loadtk	  s    WW^^L1
,,,"*"5"5z C D D $''..78(..."*"6"6 E F F
 $ "Di2fe,  +  (  ]%: M($,,7r   c                    [        U R                  R                  5       5       H  oR                  5         M     U R                  R                  SU R                  5        [        R                  U 5        [        (       a  [        U L a  Sq	ggg)z`Destroy this and all descendants widgets. This will
end the application of this Tcl interpreter.r   N)
r   rv  valuesr   r<   r  r  r  r   r   rO   r0   s     r   r   
Tk.destroy	  s`     dmm**,-Ayy{-Y(T  ]d%: M &; r   c                 z   SSK nSUR                  ;   a  UR                  S   nOUR                  nUR                  R	                  USU-  5      nUR                  R	                  USU-  5      nUR                  R	                  USU-  5      nUR                  R	                  USU-  5      nSU 0n	[        SU	5        UR                  R                  U5      (       a  U R                  R                  SU5        UR                  R                  U5      (       a#  [        [        U5      R                  5       U	5        UR                  R                  U5      (       a  U R                  R                  SU5        UR                  R                  U5      (       a$  [        [        U5      R                  5       U	5        gg)	zInternal function. It reads .BASENAME.tcl and .CLASSNAME.tcl into
the Tcl Interpreter and calls exec on the contents of .BASENAME.py and
.CLASSNAME.py if such a file exists in the home directory.r   NHOMEz.%s.tclz.%s.pyrO   zfrom tkinter import *source)r  environcurdirr  r   execisfiler<   r  openread)
rO   r  r6  r  home	class_tclclass_pybase_tclbase_pydirs
             r   r  Tk.readprofile	  sD    	RZZ

6(:YYdGGLLy9'<=	77<<h&:;77<<i(&:;'',,tX%89tn$c*77>>)$$GGLL9-77>>(##h$$&,77>>(##GGLL8,77>>'""g##%s+ #r   c                     SSK n[        S[        R                  S9  U[        l        U[        l        U[        l        U[        l        UR                  XU5        g)zReport callback exception on sys.stderr.

Applications may want to override this internal function, and
should when sys.stderr is None.r   NzException in Tkinter callbackfile)		tracebackr,   r  stderrlast_exc	last_type
last_valuelast_tracebackprint_exception)rO   r  r  r  rJ  s        r   r  Tk.report_callback_exception	  sC    
 	-CJJ?!!#B/r   c                 .    [        U R                  U5      $ )z3Delegate attribute access to the interpreter object)r   r<   )rO   attrs     r   __getattr__Tk.__getattr__	  s    tww%%r   )r  r  rv  r   r<   )NNr   TFN)rR   rS   rT   rU   r   r  r  r'  r  r   r  r  rT  rV   r!   r   r   r   r   	  s6    @	BAE-12:
84!,,0&r   r   rH  c                ,    [        U 5      n [        XS9  g )NrH  )r   r,   )rU  rI  s     r   r  r  	  s     *C	#r   c                     [        XX#5      $ r+  )r   )r  r  r6  r   s       r   TclrX  
  s    jI55r   c                   |    \ rS rSrSr0 4S jr\=r=rrS r	\	r
S r\r\R                  =rr\R                   =rrSrg)Packi
  zMGeometry manager Pack.

Base class to use the methods pack_* in every widget.c                 x    U R                   R                  SSU R                  4U R                  X5      -   5        g)a  Pack a widget in the parent widget. Use as options:
after=widget - pack it after you have packed widget
anchor=NSEW (or subset) - position widget according to
                          given direction
before=widget - pack it before you will pack widget
expand=bool - expand widget if parent size grows
fill=NONE or X or Y or BOTH - fill widget if widget grows
in=master - use master to contain this widget
in_=master - see 'in' option description
ipadx=amount - add internal padding in x direction
ipady=amount - add internal padding in y direction
padx=amount - add padding in x direction
pady=amount - add padding in y direction
side=TOP or BOTTOM or LEFT or RIGHT -  where to add this widget.
r  r  Nr  r  s      r   pack_configurePack.pack_configure
  s3      	{DGG,c&'	(r   c                 R    U R                   R                  SSU R                  5        g)z:Unmap this widget and do not use it for the packing order.r  r  Nr  rN   s    r   pack_forgetPack.pack_forget0
      VXtww/r   c                     [        U R                  U R                  R                  SSU R                  5      5      nSU;   a  U R	                  US   5      US'   U$ )z=Return information about the packing options
for this widget.r  r
  inrB   r<   r  r  r  rO   ds     r   	pack_infoPack.pack_info6
  M     twwVVTWW EF19''$0AdGr   r!   N)rR   rS   rT   rU   r   r\  r  r  rP  r_  r  rg  r
  r  r  r  r  r  rV   r!   r   r   rZ  rZ  
  sZ    = "$ (( !/.D.9v0 F D!%!4!44I+++F[r   rZ  c                   `    \ rS rSrSr0 4S jr\=r=rrS r	\	r
S r\r\R                  =rrSrg)PlaceiC
  zOGeometry manager Place.

Base class to use the methods place_* in every widget.c                 x    U R                   R                  SSU R                  4U R                  X5      -   5        g)a  Place a widget in the parent widget. Use as options:
in=master - master relative to which the widget is placed
in_=master - see 'in' option description
x=amount - locate anchor of this widget at position x of master
y=amount - locate anchor of this widget at position y of master
relx=amount - locate anchor of this widget between 0.0 and 1.0
              relative to width of master (1.0 is right edge)
rely=amount - locate anchor of this widget between 0.0 and 1.0
              relative to height of master (1.0 is bottom edge)
anchor=NSEW (or subset) - position anchor according to given direction
width=amount - width of this widget in pixel
height=amount - height of this widget in pixel
relwidth=amount - width of this widget between 0.0 and 1.0
                  relative to width of master (1.0 is the same width
                  as the master)
relheight=amount - height of this widget between 0.0 and 1.0
                   relative to height of master (1.0 is the same
                   height as the master)
bordermode="inside" or "outside" - whether to take border width of
                                   master widget into account
r  r  Nr  r  s      r   place_configurePlace.place_configureH
  s3    , 	TWW-c&'	(r   c                 R    U R                   R                  SSU R                  5        g)Unmap this widget.r  r  Nr  rN   s    r   place_forgetPlace.place_forgetd
  s    Wh0r   c                     [        U R                  U R                  R                  SSU R                  5      5      nSU;   a  U R	                  US   5      US'   U$ )z=Return information about the placing options
for this widget.r  r
  rc  rd  re  s     r   
place_infoPlace.place_infoj
  sM     twwWfdgg FG19''$0AdGr   r!   N)rR   rS   rT   rU   r   rm  r  r  rP  rq  r  rt  r
  r  r  r  rV   r!   r   r   rk  rk  C
  sJ    > #% (4 "10E0I1 F D ---F\r   rk  c                      \ rS rSrSr0 4S jr\=r=rr\	R                  =rr
\	R                  =rrS r\rS rS r\r\	R&                  =rr\	R*                  =rr\	R.                  =rr\	R2                  =rr\	R6                  =rrSrg)	Gridiv
  zMGeometry manager Grid.

Base class to use the methods grid_* in every widget.c                 x    U R                   R                  SSU R                  4U R                  X5      -   5        g)a  Position a widget in the parent widget in a grid. Use as options:
column=number - use cell identified with given column (starting with 0)
columnspan=number - this widget will span several columns
in=master - use master to contain this widget
in_=master - see 'in' option description
ipadx=amount - add internal padding in x direction
ipady=amount - add internal padding in y direction
padx=amount - add padding in x direction
pady=amount - add padding in y direction
row=number - use cell identified with given row (starting with 0)
rowspan=number - this widget will span several rows
sticky=NSEW - if cell is larger on which sides will this
              widget stick to the cell boundary
r  r  Nr  r  s      r   grid_configureGrid.grid_configure|
  s3     	{DGG,c&'	(r   c                 R    U R                   R                  SSU R                  5        g)rp  r  r  Nr  rN   s    r   grid_forgetGrid.grid_forget
  ra  r   c                 R    U R                   R                  SSU R                  5        g)z0Unmap this widget but remember the grid options.r  r@  Nr  rN   s    r   grid_removeGrid.grid_remove
  ra  r   c                     [        U R                  U R                  R                  SSU R                  5      5      nSU;   a  U R	                  US   5      US'   U$ )zKReturn information about the options
for positioning this widget in a grid.r  r
  rc  rd  re  s     r   	grid_infoGrid.grid_info
  ri  r   r!   N)rR   rS   rT   rU   r   ry  r  r  rP  r  r  r  r  r  r|  r  r  r  r
  r  r  r  r  r  r  r  r  r  r  rV   r!   r   r   rw  rw  v
  s    =
 "$ (& !/.D.9v~~%D9-1-F-FFO*0 F0 D#111H}!%!4!44I'+'='==L$~~%D9+++F[r   rw  c                   >    \ rS rSrSrS r0 0 S4S jrS rS
S jrSr	g	)
BaseWidgeti
  zInternal class.c                    Uc
  [        5       nXl        UR                  U l        SnSU;   a  US   nUS	 U(       d  U R                  R                  R                  5       nUS   R                  5       (       a  US-  nUR                  c  0 Ul        UR                  R                  US5      S-   nXAR                  U'   US:X  a  SU< 3nOSX44-  nX0l	        UR                  S:X  a  SU-   U l
        OUR                  S-   U-   U l
        0 U l        U R                  U R                  R                  ;   a1  U R                  R                  U R                     R                  5         X R                  R                  U R                  '   g)	z6Internal function. Sets up information about children.Nr   r  !r   r   z!%s%drH   )r   r   r<   rV  rR   rX  isdigitrB  r(  r  r  rv  r   )rO   r   r/   r   counts        r   _setupBaseWidget._setup
  sL   >&(F))S=v;DF>>**002DBx!!%%-)+&**..tQ7!;E+0""4(z $$.
99c>DjDGii#o,DG::---KK  ,446+/TZZ(r   r!   c                    U(       a  [        X445      nX l        U R                  X5        U R                  c  / U l        UR	                  5        VVs/ s H  u  pg[        U[        5      (       d  M  Xg4PM!     nnnU H  u  pgX6	 M	     U R                  R                  X R                  4U-   U R                  U5      -   5        U H  u  pgUR                  X5        M     gs  snnf )z\Construct a widget with the parent widget MASTER, a name WIDGETNAME
and appropriate options.N)r4   
widgetNamer  r  r-   r   r(   r<   r  r  r  r  )	rO   r   r  r/   r  extrar2   r3   classess	            r   r  BaseWidget.__init__
  s     SI&C$F $ "D&)iikIkdaZ45H6A6kIDA !E)DMM#,>>	@DAKK   Js   C 1C c                 v   [        U R                  R                  5       5       H  oR                  5         M     U R                  R                  SU R                  5        U R                  U R                  R                  ;   a!  U R                  R                  U R                  	 [        R                  U 5        g)z)Destroy this and all descendants widgets.r   N)
r   rv  r4  r   r<   r  r  r  r   r  r5  s     r   r   BaseWidget.destroy
  sp    dmm**,-Ayy{-Y(::---$$TZZ0Tr   c                 V    U R                   R                  U R                  U4U-   5      $ r+  r  )rO   r   r  s      r   _doBaseWidget._do
  s"    ww||TWWdOd233r   )r  r  r  rv  r   r<   r  N)r!   )
rR   rS   rT   rU   r   r  r  r   r  rV   r!   r   r   r  r  
  s#    0@ 02b !"4r   r  c                       \ rS rSrSrSrg)Widgeti
  zpInternal class.

Base class for a widget which can be positioned with the geometry managers
Pack, Place or Grid.r!   N)rR   rS   rT   rU   r   rV   r!   r   r   r  r  
  s     	r   r  c                   &    \ rS rSrSrS0 4S jrSrg)Topleveli
  z"Toplevel widget, e.g. for dialogs.Nc                    U(       a  [        X#45      nSnS H-  nXR;   d  M
  X%   nUS   S:X  a	  SUSS -   nOSU-   nXGU4-   nX%	 M/     [        R                  XSU0 U5        U R                  5       nU R	                  UR	                  5       5        U R                  UR                  5       5        U R                  SU R                  5        g)	a  Construct a toplevel widget with the parent MASTER.

Valid option names: background, bd, bg, borderwidth, class,
colormap, container, cursor, height, highlightbackground,
highlightcolor, highlightthickness, menu, relief, screen, takefocus,
use, visual, width.r!   )r  class_r}  r  colormapr  r  r7   Nr  r/  )r4   r  r  r  r  r  r  r   )	rO   r   r/   r  r  wmkeyr  optr   s	            r   r  Toplevel.__init__
  s     SI&CE|j 9#3uSbz>SIcc
*J 	D*c2uEzz|dmmo&

4::< ($,,7r   r!   rR   rS   rT   rU   r   r  rV   r!   r   r   r  r  
  s    ," 8r   r  c                   2    \ rS rSrSrS0 4S jrS rS rSrg)r   i  zButton widget.Nc                 2    [         R                  XSX#5        g)a  Construct a button widget with the parent MASTER.

STANDARD OPTIONS

    activebackground, activeforeground, anchor,
    background, bitmap, borderwidth, cursor,
    disabledforeground, font, foreground
    highlightbackground, highlightcolor,
    highlightthickness, image, justify,
    padx, pady, relief, repeatdelay,
    repeatinterval, takefocus, text,
    textvariable, underline, wraplength

WIDGET-SPECIFIC OPTIONS

    command, compound, default, height,
    overrelief, state, width
buttonNr  r  rO   r   r/   r  s       r   r  Button.__init__  s    & 	h8r   c                 P    U R                   R                  U R                  S5        g)a'  Flash the button.

This is accomplished by redisplaying
the button several times, alternating between active and
normal colors. At the end of the flash the button is left
in the same normal/active state as when the command was
invoked. This command is ignored if the button's state is
disabled.
flashNr  rN   s    r   r  Button.flash,  s     	TWWg&r   c                 N    U R                   R                  U R                  S5      $ )zInvoke the command associated with the button.

The return value is the return value from the command,
or an empty string if there is no command associated with
the button. This command is ignored if the button's state
is disabled.
invoker  rN   s    r   r  Button.invoke8  s     ww||DGGX..r   r!   )	rR   rS   rT   rU   r   r  r  r  rV   r!   r   r   r   r     s    " 9*
'/r   r   c                      \ rS rSrSrS0 4S jrS rS rS rS r	S>S	 jr
S
 rS rS rS rS?S j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S rS rS rS rS rS rS r S  r!S! r"S" r#S# r$S>S$ jr%S% r&S& r'S' r(S( r)S) r*S* r+S+ r,S, r-S- r.S?S. jr/\/r0S/ r1\1r2S0 r3SAS1 jr40 4S2 jr5S3 r6\6=r7r8S4 r9S5 r:SBS6 jr;S7 r<S8 r=S9 r>S: r?S; r@S< rAS=rBg)CCanvasiC  z?Canvas widget to display graphical elements like lines or text.Nc                 2    [         R                  XSX#5        g)a  Construct a canvas widget with the parent MASTER.

Valid option names: background, bd, bg, borderwidth, closeenough,
confine, cursor, height, highlightbackground, highlightcolor,
highlightthickness, insertbackground, insertborderwidth,
insertofftime, insertontime, insertwidth, offset, relief,
scrollregion, selectbackground, selectborderwidth, selectforeground,
state, takefocus, width, xscrollcommand, xscrollincrement,
yscrollcommand, yscrollincrement.canvasNr  r  s       r   r  Canvas.__init__F  s     	h8r   c                 X    U R                   R                  U R                  S4U-   5        g)r   addtagNr  rW  s     r   r  Canvas.addtagR       dggx(4/0r   c                 *    U R                  USU5        g)z*Add tag NEWTAG to all items above TAGORID.aboveNr  rO   newtagtagOrIds      r   addtag_aboveCanvas.addtag_aboveV      FGW-r   c                 (    U R                  US5        g)zAdd tag NEWTAG to all items.rm  Nr  )rO   r  s     r   
addtag_allCanvas.addtag_allZ  s    FE"r   c                 *    U R                  USU5        g)z*Add tag NEWTAG to all items below TAGORID.belowNr  r  s      r   addtag_belowCanvas.addtag_below^  r  r   c                 ,    U R                  USX#XE5        g)zAdd tag NEWTAG to item which is closest to pixel at X, Y.
If several match take the top-most.
All items closer than HALO are considered overlapping (all are
closest). If START is specified the next below this tag is taken.closestNr  )rO   r  r   r   halostarts         r   addtag_closestCanvas.addtag_closestb  s    
 	FIqT9r   c                 ,    U R                  USX#XE5        g)zDAdd tag NEWTAG to all items in the rectangle defined
by X1,Y1,X2,Y2.enclosedNr  rO   r  x1y1x2y2s         r   addtag_enclosedCanvas.addtag_enclosedi  s     	FJ7r   c                 ,    U R                  USX#XE5        g)zOAdd tag NEWTAG to all items which overlap the rectangle
defined by X1,Y1,X2,Y2.overlappingNr  r  s         r   addtag_overlappingCanvas.addtag_overlappingn  s     	FM22:r   c                 *    U R                  USU5        g)z)Add tag NEWTAG to all items with TAGORID.withtagNr  r  s      r   addtag_withtagCanvas.addtag_withtags  s    FIw/r   c                     U R                  U R                  R                  U R                  S4U-   5      5      =(       d    S$ )ztReturn a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
which encloses all items with tags specified as arguments.r  Nr  rW  s     r   r  Canvas.bboxw  s;     }}GGLL$''6*T124 <7;	<r   c                 B    U R                  U R                  SX4U5        g)zZUnbind for all items with TAGORID for event SEQUENCE  the
function identified with FUNCID.rX  Nr]  )rO   r  rR  rT  s       r   
tag_unbindCanvas.tag_unbind}  s     	dggvw96Br   c                 B    U R                  U R                  SU4X#U5      $ )a  Bind to all items with TAGORID at event SEQUENCE a call to function FUNC.

An additional boolean parameter ADD specifies whether FUNC will be
called additionally to the other bound function or whether it will
replace the previous function. See bind for the return value.rX  rY  )rO   r  rR  r  r8  s        r   tag_bindCanvas.tag_bind  s'     zz477FG4#' 	'r   c                     U R                   R                  U R                   R                  U R                  SX5      5      $ )zjReturn the canvas x coordinate of pixel position SCREENX rounded
to nearest multiple of GRIDSPACING units.canvasxr  )rO   screenxgridspacings      r   r  Canvas.canvasx  5     ww  GGY"6 7 	7r   c                     U R                   R                  U R                   R                  U R                  SX5      5      $ )zjReturn the canvas y coordinate of pixel position SCREENY rounded
to nearest multiple of GRIDSPACING units.canvasyr  )rO   screenyr  s      r   r  Canvas.canvasy  r  r   c                     [        U5      nU R                  R                  U R                  R                  U R                  S4U-   5      5       Vs/ s H  o R                  R                  U5      PM     sn$ s  snf )z8Return a list of coordinates for the item given in ARGS.coords)r"   r<   r8   r  r  rj  r  s      r   r  Canvas.coords  sn    ~77,,77<<( 3d :;=>= *+!!!$=> 	> >s   $A8c           
         [        U5      nUS   n[        U[        [        45      (       a  USS nO0 nU R                  R                  U R                  R                  " U R                  SU/X R                  XC5      -   Q76 5      $ )r   r  Nr  )	r"   r   r'   r   r<   ri  r  r  r  )rO   itemTyper  r  r/   s        r   _createCanvas._create  sx    ~2hcD%=))9DCww~~dggllGGXx.]]3++. / 	/r   c                 &    U R                  SX5      $ )z6Create arc shaped region with coordinates x1,y1,x2,y2.arcr  r  s      r   
create_arcCanvas.create_arc  s    ||E4,,r   c                 &    U R                  SX5      $ )z%Create bitmap with coordinates x1,y1.r  r  r  s      r   create_bitmapCanvas.create_bitmap      ||Hd//r   c                 &    U R                  SX5      $ )z)Create image item with coordinates x1,y1.r4  r  r  s      r   create_imageCanvas.create_image  s    ||GT..r   c                 &    U R                  SX5      $ )z-Create line with coordinates x1,y1,...,xn,yn.rd  r  r  s      r   create_lineCanvas.create_line      ||FD--r   c                 &    U R                  SX5      $ )z)Create oval with coordinates x1,y1,x2,y2.ovalr  r  s      r   create_ovalCanvas.create_oval  r  r   c                 &    U R                  SX5      $ )z0Create polygon with coordinates x1,y1,...,xn,yn.polygonr  r  s      r   create_polygonCanvas.create_polygon  s    ||It00r   c                 &    U R                  SX5      $ )z.Create rectangle with coordinates x1,y1,x2,y2.	rectangler  r  s      r   create_rectangleCanvas.create_rectangle  s    ||K22r   c                 &    U R                  SX5      $ )z#Create text with coordinates x1,y1.textr  r  s      r   create_textCanvas.create_text  r  r   c                 &    U R                  SX5      $ )z+Create window with coordinates x1,y1,x2,y2.r  r  r  s      r   create_windowCanvas.create_window  r  r   c                 X    U R                   R                  U R                  S4U-   5        g)zDelete characters of text items identified by tag or id in ARGS (possibly
several times) from FIRST to LAST character (including).dcharsNr  rW  s     r   r  Canvas.dchars  "     	dggx(4/0r   c                 X    U R                   R                  U R                  S4U-   5        g)z<Delete items identified by all tag or ids contained in ARGS.r(  Nr  rW  s     r   r(  Canvas.delete  r  r   c                 X    U R                   R                  U R                  S4U-   5        g)zaDelete tag or id given as last arguments in ARGS from items
identified by first argument in ARGS.dtagNr  rW  s     r   r   Canvas.dtag  s"     	dggv&-.r   c                     U R                  U R                  R                  U R                  S4U-   5      5      =(       d    S$ )r   findr!   r  rW  s     r   r#  Canvas.find  9    }}GGLL$''6*T124 :79	:r   c                 &    U R                  SU5      $ )zReturn items above TAGORID.r  r#  rO   r  s     r   
find_aboveCanvas.find_above      yy'**r   c                 $    U R                  S5      $ )zReturn all items.rm  r'  rN   s    r   find_allCanvas.find_all  s    yyr   c                 &    U R                  SU5      $ )zReturn all items below TAGORID.r  r'  r(  s     r   
find_belowCanvas.find_below  r+  r   c                 (    U R                  SXX45      $ )zReturn item which is closest to pixel at X, Y.
If several match take the top-most.
All items closer than HALO are considered overlapping (all are
closest). If START is specified the next below this tag is taken.r  r'  )rO   r   r   r  r  s        r   find_closestCanvas.find_closest  s    
 yyA$66r   c                 (    U R                  SXX45      $ )z5Return all items in rectangle defined
by X1,Y1,X2,Y2.r  r'  rO   r  r  r  r  s        r   find_enclosedCanvas.find_enclosed  s     yyRR44r   c                 (    U R                  SXX45      $ )zDReturn all items which overlap the rectangle
defined by X1,Y1,X2,Y2.r  r'  r6  s        r   find_overlappingCanvas.find_overlapping  s     yy77r   c                 &    U R                  SU5      $ )zReturn all items with TAGORID.r  r'  r(  s     r   find_withtagCanvas.find_withtag  s    yyG,,r   c                 V    U R                   R                  U R                  S4U-   5      $ )z.Set focus to the first item specified in ARGS.r   r  rW  s     r   r   Canvas.focus  s#    ww||TWWg.566r   c                     U R                   R                  U R                   R                  U R                  S4U-   5      5      $ )z=Return tags associated with the first item specified in ARGS.gettagsrJ  rW  s     r   rB  Canvas.gettags  s7    ww  GGLL$''9-457 	7r   c                 X    U R                   R                  U R                  S4U-   5        g)z\Set cursor at position POS in the item identified by TAGORID.
In ARGS TAGORID must be first.icursorNr  rW  s     r   rE  Canvas.icursor  s"     	dggy)D01r   c                     U R                   R                  U R                   R                  U R                  S4U-   5      5      $ )z?Return position of cursor as integer in item specified in ARGS.r  rq  rW  s     r   r  Canvas.index  s0    ww~~dggllDGGW+=+DEFFr   c                 X    U R                   R                  U R                  S4U-   5        g)zKInsert TEXT in item TAGORID at position POS. ARGS must
be TAGORID POS TEXT.insertNr  rW  s     r   rJ  Canvas.insert  r  r   c                 `    U R                   R                  U R                  S4USU-   4-   5      $ )z,Return the value of OPTION for item TAGORID.itemcgetr7   r  )rO   r  r  s      r   rM  Canvas.itemcget  s1    ww||WWj!Wc&j$99; 	;r   c                 *    U R                  SU4X#5      $ )zQuery or modify the configuration options of an item TAGORID.

Similar to configure() except that it applies to the specified item.
itemconfigurer  rO   r  r/   r  s       r   rP  Canvas.itemconfigure  s    
 93CCr   c                 X    U R                   R                  U R                  S4U-   5        g)zBLower an item TAGORID given in ARGS
(optional below another item).rX  Nr  rW  s     r   	tag_lowerCanvas.tag_lower+  "     	dggw'$./r   c                 X    U R                   R                  U R                  S4U-   5        g)z#Move an item TAGORID given in ARGS.moveNr  rW  s     r   rX  Canvas.move2  s     dggv&-.r   c                 T    U R                   R                  U R                  SXU5        g)aU  Move the items given by TAGORID in the canvas coordinate
space so that the first coordinate pair of the bottommost
item with tag TAGORID is located at position (X,Y).
X and Y may be the empty string, in which case the
corresponding coordinate will be unchanged. All items matching
TAGORID remain in the same positions relative to each other.rc  Nr  )rO   r  r   r   s       r   rc  Canvas.moveto6  s     	TWWhA6r   c                 t    U R                   R                  U R                  S4U R                  X5      -   5      $ )zPrint the contents of the canvas to a postscript
file. Valid options: colormap, colormode, file, fontmap,
height, pageanchor, pageheight, pagewidth, pagex, pagey,
rotate, width, x, y.
postscriptr  r  s      r   r]  Canvas.postscript?  s5    
 ww||TWWl3MM#*+ , 	,r   c                 X    U R                   R                  U R                  S4U-   5        g)zBRaise an item TAGORID given in ARGS
(optional above another item).r]  Nr  rW  s     r   	tag_raiseCanvas.tag_raiseG  rV  r   c                 X    U R                   R                  U R                  S4U-   5        g)z9Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE.scaleNr  rW  s     r   rc  Canvas.scaleN  s     dggw'$./r   c                 T    U R                   R                  U R                  SSX5        gz&Remember the current X, Y coordinates.scanmarkNr  r  s      r   	scan_markCanvas.scan_markR      TWWffa3r   c                 V    U R                   R                  U R                  SSXU5        g)zrAdjust the view of the canvas to GAIN times the
difference between X and Y and the coordinates given in
scan_mark.rg  dragtoNr  )rO   r   r   gains       r   scan_dragtoCanvas.scan_dragtoV  s      	TWWfhd;r   c                 T    U R                   R                  U R                  SSX5        g)zLAdjust the end of the selection near the cursor of an item TAGORID to index.selectadjustNr  rO   r  r  s      r   select_adjustCanvas.select_adjust\  s    TWWh'Ar   c                 R    U R                   R                  U R                  SS5        g),Clear the selection if it is in this widget.rr  r  Nr  rN   s    r   select_clearCanvas.select_clear`  s    TWWh0r   c                 T    U R                   R                  U R                  SSX5        g)z:Set the fixed end of a selection in item TAGORID to INDEX.rr  fromNr  rt  s      r   select_fromCanvas.select_fromd  s    TWWh?r   c                 b    U R                   R                  U R                  SS5      =(       d    S$ )z(Return the item which has the selection.rr  r%   Nr  rN   s    r   select_itemCanvas.select_itemh  s"    ww||DGGXv6>$>r   c                 T    U R                   R                  U R                  SSX5        g)z=Set the variable end of a selection in item TAGORID to INDEX.rr  toNr  rt  s      r   	select_toCanvas.select_tol  s    TWWhg=r   c                 b    U R                   R                  U R                  SU5      =(       d    S$ )z$Return the type of the item TAGORID.r(   Nr  r(  s     r   r(   Canvas.typep  s"    ww||DGGVW5==r   r!   rA  r+  rZ  )r   r   )
   )CrR   rS   rT   rU   r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r(  r   r#  r)  r-  r0  r3  r7  r:  r=  r   rB  rE  r  rJ  rM  rP  
itemconfigrT  rX  rX  rc  r]  r`  rM  r_  rc  ri  ro  ru  ry  r}  r  r  r(   rV   r!   r   r   r  r  C  sK   I" 
91.#.:8
;
0<C
'77>
/-0/..13.01
1/
:
+ +75
8
-77
2
G1
;
D J0
 E/7   ,0
 D704<B1@?>>r   r  c                   X   ^  \ rS rSrSrS0 4S jrU 4S jrS rS rS r	S	 r
S
 rSrU =r$ )Checkbuttoniw  z7Checkbutton widget which is either in on- or off-state.Nc                 2    [         R                  XSX#5        g)a  Construct a checkbutton widget with the parent MASTER.

Valid option names: activebackground, activeforeground, anchor,
background, bd, bg, bitmap, borderwidth, command, cursor,
disabledforeground, fg, font, foreground, height,
highlightbackground, highlightcolor, highlightthickness, image,
indicatoron, justify, offvalue, onvalue, padx, pady, relief,
selectcolor, selectimage, state, takefocus, text, textvariable,
underline, variable, width, wraplength.checkbuttonNr  r  s       r   r  Checkbutton.__init__z       	mS=r   c                    > UR                  S5      (       d<  U R                  R                  R                  5       n[        S-  qSU S[         3US'   [
        TU ]  X5        g )Nr   r   r  r7   )r(  rV  rR   rX  _checkbutton_countsuperr  )rO   r   r/   r   rV  s       r   r  Checkbutton._setup  s[     wwv>>**002D!# dV1%7$89CKv#r   c                 P    U R                   R                  U R                  S5        gzPut the button in off-state.deselectNr  rN   s    r   r  Checkbutton.deselect  s    TWWj)r   c                 P    U R                   R                  U R                  S5        gzFlash the button.r  Nr  rN   s    r   r  Checkbutton.flash      TWWg&r   c                 N    U R                   R                  U R                  S5      $ z:Toggle the button and invoke a command if given as option.r  r  rN   s    r   r  Checkbutton.invoke      ww||DGGX..r   c                 P    U R                   R                  U R                  S5        gzPut the button in on-state.rr  Nr  rN   s    r   rr  Checkbutton.select      TWWh'r   c                 P    U R                   R                  U R                  S5        g)zToggle the button.toggleNr  rN   s    r   r  Checkbutton.toggle  r  r   r!   )rR   rS   rT   rU   r   r  r  r  r  r  rr  r  rV   __classcell__)rV  s   @r   r  r  w  s3    A" 
>$*'/(( (r   r  c                       \ rS rSrSrS0 4S jrSS jrS rS rS r	S	 r
S
 rS rS r\rS r\rS r\rS r\rS r\rS r\rSrg)Entryi  z1Entry widget which allows displaying simple text.Nc                 2    [         R                  XSX#5        g)a  Construct an entry widget with the parent MASTER.

Valid option names: background, bd, bg, borderwidth, cursor,
exportselection, fg, font, foreground, highlightbackground,
highlightcolor, highlightthickness, insertbackground,
insertborderwidth, insertofftime, insertontime, insertwidth,
invalidcommand, invcmd, justify, relief, selectbackground,
selectborderwidth, selectforeground, show, state, takefocus,
textvariable, validate, validatecommand, vcmd, width,
xscrollcommand.entryNr  r  s       r   r  Entry.__init__  s     	gs7r   c                 R    U R                   R                  U R                  SX5        g)z.Delete text from FIRST to LAST (not included).r(  Nr  rO   firstlasts      r   r(  Entry.delete      TWWh4r   c                 N    U R                   R                  U R                  S5      $ )zReturn the text.r(  r  rN   s    r   r(  	Entry.get      ww||DGGU++r   c                 R    U R                   R                  U R                  SU5        g)zInsert cursor at INDEX.rE  Nr  rO   r  s     r   rE  Entry.icursor  s    TWWi/r   c                     U R                   R                  U R                   R                  U R                  SU5      5      $ )zReturn position of cursor.r  rq  r  s     r   r  Entry.index  s1    ww~~dggllGGWe% & 	&r   c                 R    U R                   R                  U R                  SX5        g)zInsert STRING at INDEX.rJ  Nr  )rO   r  r  s      r   rJ  Entry.insert  s    TWWh6r   c                 T    U R                   R                  U R                  SSU5        grf  r  rQ  s     r   ri  Entry.scan_mark  s    TWWffa0r   c                 T    U R                   R                  U R                  SSU5        g)zpAdjust the view of the canvas to 10 times the
difference between X and Y and the coordinates given in
scan_mark.rg  rm  Nr  rQ  s     r   ro  Entry.scan_dragto  s     	TWWfh2r   c                 T    U R                   R                  U R                  SSU5        g)z9Adjust the end of the selection near the cursor to INDEX.r?  rs  Nr  r  s     r   selection_adjustEntry.selection_adjust      TWWk8U;r   c                 R    U R                   R                  U R                  SS5        g)rx  r?  r  Nr  rN   s    r   r@  Entry.selection_clear  s    TWWk73r   c                 T    U R                   R                  U R                  SSU5        g)*Set the fixed end of a selection to INDEX.r?  r|  Nr  r  s     r   selection_fromEntry.selection_from  s    TWWk659r   c                     U R                   R                  U R                   R                  U R                  SS5      5      $ )zKReturn True if there are characters selected in the entry, False
otherwise.r?  presentr	  rN   s    r   selection_presentEntry.selection_present  3     ww!!GGLL+y9; 	;r   c                 T    U R                   R                  U R                  SSX5        g)3Set the selection from START to END (not included).r?  rangeNr  rO   r  ends      r   selection_rangeEntry.selection_range  s    TWWk7E?r   c                 T    U R                   R                  U R                  SSU5        g)-Set the variable end of a selection to INDEX.r?  r  Nr  r  s     r   selection_toEntry.selection_to  s    TWWk47r   r!   r+  )rR   rS   rT   rU   r   r  r(  r(  rE  r  rJ  ri  ro  r  ru  r@  ry  r  r}  r  select_presentr  select_ranger  r  rV   r!   r   r   r  r    s{    ;" 85,0&
713< %M4 #L: !K; 'N@ #L8 Ir   r  c                   &    \ rS rSrSrS0 4S jrSrg)Framei  zFFrame widget which may contain other widgets and can have a 3D border.Nc                     [        X#45      nSnSU;   a  SUS   4nUS	 OSU;   a
  SUS   4nUS	 [        R                  XSU0 U5        g)zConstruct a frame widget with the parent MASTER.

Valid option names: background, bd, bg, borderwidth, class,
colormap, container, cursor, height, highlightbackground,
highlightcolor, highlightthickness, relief, takefocus, visual, width.r!   r  z-classr}  r  N)r4   r  r  )rO   r   r/   r  r  s        r   r  Frame.__init__  sa     	"s?s8}-EH^s7|,EGgsB>r   r!   r  r!   r   r   r  r    s    P" ?r   r  c                   &    \ rS rSrSrS0 4S jrSrg)Labeli  z0Label widget which can display text and bitmaps.Nc                 2    [         R                  XSX#5        g)a  Construct a label widget with the parent MASTER.

STANDARD OPTIONS

    activebackground, activeforeground, anchor,
    background, bitmap, borderwidth, cursor,
    disabledforeground, font, foreground,
    highlightbackground, highlightcolor,
    highlightthickness, image, justify,
    padx, pady, relief, takefocus, text,
    textvariable, underline, wraplength

WIDGET-SPECIFIC OPTIONS

    height, state, width

labelNr  r  s       r   r  Label.__init__  s    $ 	gs7r   r!   r  r!   r   r   r  r    s    :" 8r   r  c                       \ rS rSrSrS0 4S jrS rS rS rSS jr	SS	 jr
S
 rS rS rS rS rS rS r\rSS jr\rS r\rSS jr\rS rS rSS jr\rSrg)Listboxi*  z3Listbox widget which can display a list of strings.Nc                 2    [         R                  XSX#5        g)al  Construct a listbox widget with the parent MASTER.

Valid option names: background, bd, bg, borderwidth, cursor,
exportselection, fg, font, foreground, height, highlightbackground,
highlightcolor, highlightthickness, relief, selectbackground,
selectborderwidth, selectforeground, selectmode, setgrid, takefocus,
width, xscrollcommand, yscrollcommand, listvariable.listboxNr  r  s       r   r  Listbox.__init__-  s     	i9r   c                 R    U R                   R                  U R                  SU5        g)z"Activate item identified by INDEX.activateNr  r  s     r   r  Listbox.activate7      TWWj%0r   c                     U R                  U R                  R                  U R                  SU5      5      =(       d    S$ )zpReturn a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
which encloses the item identified by the given index.r  Nr  r  s     r   r  Listbox.bbox;  s-     }}TWW\\$''65ABJdJr   c                 ~    U R                  U R                  R                  U R                  S5      5      =(       d    S$ )z.Return the indices of currently selected item.curselectionr!   r  rN   s    r   r  Listbox.curselection@  s)    }}TWW\\$''>BCIrIr   c                 R    U R                   R                  U R                  SX5        g)z+Delete items from FIRST to LAST (included).r(  Nr  r  s      r   r(  Listbox.deleteD  r  r   c                     Ub@  U R                   R                  U R                   R                  U R                  SX5      5      $ U R                   R                  U R                  SU5      $ )z0Get list of items from FIRST to LAST (included).r(  rJ  r  s      r   r(  Listbox.getH  sV    77$$TWW\\&- . . 77<<66r   c                     U R                   R                  U R                  SU5      nUS:X  a  gU R                   R                  U5      $ )z+Return index of item identified with INDEX.r  r  Nr<   r  r  ri  rO   r  r   s      r   r  Listbox.indexP  s8    GGLL'51;tww~~a  r   c                 Z    U R                   R                  U R                  SU4U-   5        g)zInsert ELEMENTS at INDEX.rJ  Nr  )rO   r  elementss      r   rJ  Listbox.insertV  s"    dggx/(:;r   c                     U R                   R                  U R                   R                  U R                  SU5      5      $ )z5Get index of item which is nearest to y coordinate Y.nearestrq  )rO   r   s     r   r   Listbox.nearestZ  s1    ww~~dggllGGY# $ 	$r   c                 T    U R                   R                  U R                  SSX5        grf  r  r  s      r   ri  Listbox.scan_mark_  rk  r   c                 T    U R                   R                  U R                  SSX5        g)zqAdjust the view of the listbox to 10 times the
difference between X and Y and the coordinates given in
scan_mark.rg  rm  Nr  r  s      r   ro  Listbox.scan_dragtoc       	TWWfh5r   c                 R    U R                   R                  U R                  SU5        g)z"Scroll such that INDEX is visible.seeNr  r  s     r   r  Listbox.seei      TWWeU+r   c                 T    U R                   R                  U R                  SSU5        g)z-Set the fixed end oft the selection to INDEX.r?  r  Nr  r  s     r   selection_anchorListbox.selection_anchorm  r  r   c                 T    U R                   R                  U R                  SSX5        g)z2Clear the selection from FIRST to LAST (included).r?  r  Nr  r  s      r   r@  Listbox.selection_clears  s    TWWgu	4r   c                     U R                   R                  U R                   R                  U R                  SSU5      5      $ )z.Return True if INDEX is part of the selection.r?  includesr	  r  s     r   selection_includesListbox.selection_includesz  s5    ww!!$'',,GG[*e#5 6 	6r   c                 T    U R                   R                  U R                  SSX5        g)zaSet the selection from FIRST to LAST (included) without
changing the currently selected elements.r?  r$  Nr  r  s      r   selection_setListbox.selection_set  s     	TWWk5%>r   c                     U R                   R                  U R                   R                  U R                  S5      5      $ )z-Return the number of elements in the listbox.r  rq  rN   s    r   r  Listbox.size  s(    ww~~dggll477F;<<r   c                 `    U R                   R                  U R                  S4USU-   4-   5      $ )z-Return the value of OPTION for item at INDEX.rM  r7   r  rO   r  r  s      r   rM  Listbox.itemcget  1    ww||WWj!UCJ$779 	9r   c                 *    U R                  SU4X#5      $ )zQuery or modify the configuration options of an item at INDEX.

Similar to configure() except that it applies to the specified item.
rP  r  r
  s       r   rP  Listbox.itemconfigure  s    
 7AAr   r!   r+  )rR   rS   rT   rU   r   r  r  r  r  r(  r(  r  rJ  r   ri  ro  r  r  select_anchorr@  ry  r  select_includesr  
select_setr  rM  rP  r  rV   r!   r   r   r  r  *  s    =" :1K
J57!<$
46,< %M4
 #L6
 )O?
 J=9
B Jr   r  c                      \ rS rSrSrS0 4S jrSS jrS r0 4S jr0 4S jr	0 4S	 jr
0 4S
 jr0 4S jr0 4S jr0 4S jr0 4S jr0 4S jr0 4S jr0 4S jr0 4S jrSS jrS rSS jr\rS rS rS rS rS rS rS rSrg) Menui  zPMenu widget which allows displaying menu bars, pull-down menus and pop-up menus.Nc                 2    [         R                  XSX#5        g)a  Construct menu widget with the parent MASTER.

Valid option names: activebackground, activeborderwidth,
activeforeground, background, bd, bg, borderwidth, cursor,
disabledforeground, fg, font, foreground, postcommand, relief,
selectcolor, takefocus, tearoff, tearoffcommand, title, type.menuNr  r  s       r   r  Menu.__init__  s     	fc6r   c                 T    U R                   R                  SU R                  XU5        g)z/Post the menu at position X,Y with entry ENTRY.tk_popupNr  )rO   r   r   r  s       r   r(  Menu.tk_popup  s    Z!6r   c                 R    U R                   R                  U R                  SU5        g)zActivate entry at INDEX.r  Nr  r  s     r   r  Menu.activate  r  r   c                 x    U R                   R                  U R                  SU4U R                  X#5      -   5        g)r   r8  Nr  )rO   r  r/   r  s       r   r8  Menu.add  s0    dgguh/s'( 	)r   c                 :    U R                  SU=(       d    U5        g)zAdd hierarchical menu item.cascadeNr8  r  s      r   add_cascadeMenu.add_cascade      CI2&r   c                 :    U R                  SU=(       d    U5        g)zAdd checkbutton menu item.r  Nr0  r  s      r   add_checkbuttonMenu.add_checkbutton      	r*r   c                 :    U R                  SU=(       d    U5        g)zAdd command menu item.rG  Nr0  r  s      r   add_commandMenu.add_command  r3  r   c                 :    U R                  SU=(       d    U5        g)zAdd radio menu item.radiobuttonNr0  r  s      r   add_radiobuttonMenu.add_radiobutton  r7  r   c                 :    U R                  SU=(       d    U5        g)zAdd separator.	separatorNr0  r  s      r   add_separatorMenu.add_separator  s    ciR(r   c                 x    U R                   R                  U R                  SX4U R                  X45      -   5        g)r   rJ  Nr  )rO   r  r  r/   r  s        r   rJ  Menu.insert  s0    dggx9s'( 	)r   c                 <    U R                  USU=(       d    U5        g)z$Add hierarchical menu item at INDEX.r/  NrJ  r
  s       r   insert_cascadeMenu.insert_cascade      E9ciR0r   c                 <    U R                  USU=(       d    U5        g)z#Add checkbutton menu item at INDEX.r  NrF  r
  s       r   insert_checkbuttonMenu.insert_checkbutton      E=#)4r   c                 <    U R                  USU=(       d    U5        g)zAdd command menu item at INDEX.rG  NrF  r
  s       r   insert_commandMenu.insert_command  rI  r   c                 <    U R                  USU=(       d    U5        g)zAdd radio menu item at INDEX.r<  NrF  r
  s       r   insert_radiobuttonMenu.insert_radiobutton  rM  r   c                 <    U R                  USU=(       d    U5        g)zAdd separator at INDEX.r@  NrF  r
  s       r   insert_separatorMenu.insert_separator  s    E;	r2r   c                 t   Uc  UnU R                  U5      U R                  U5      pCUb  Uc  Su  p4[        X4S-   5       HO  nSU R                  U5      ;   d  M  [        U R	                  US5      5      nU(       d  M>  U R                  U5        MQ     U R                  R                  U R                  SX5        g)z7Delete menu items between INDEX1 and INDEX2 (included).N)r   r  r   rG  r(  )	r  r  entryconfigr   	entrycgetr  r<   r  r  )rO   index1index2
num_index1
num_index2r   r0   s          r   r(  Menu.delete  s    >F!%F!3TZZ5GJJ$6%*"Jz>2AD,,Q//q)451&&q)	 3
 	TWWh7r   c                 X    U R                   R                  U R                  SUSU-   5      $ )z4Return the value of OPTION for a menu item at INDEX.rY  r7   r  r  s      r   rY  Menu.entrycget  s#    ww||DGG[%vFFr   c                 *    U R                  SU4X#5      $ )zQuery or modify the configuration options of a menu item at INDEX.

Similar to configure() except that it applies to the specified
menu item.
entryconfigurer  r
  s       r   rb  Menu.entryconfigure  s      0%8#BBr   c                     U R                   R                  U R                  SU5      nUS;   a  S$ U R                   R                  U5      $ )z4Return the index of a menu item identified by INDEX.r  )r   r  Nr  r  s      r   r  
Menu.index  s;    GGLL'51L(t?dggnnQ.??r   c                 P    U R                   R                  U R                  SU5      $ )zJInvoke a menu item identified by INDEX and execute
the associated command.r  r  r  s     r   r  Menu.invoke  s     ww||DGGXu55r   c                 R    U R                   R                  U R                  SX5        g)zDisplay a menu at position X,Y.postNr  r  s      r   ri  	Menu.post	  s    TWWfa+r   c                 P    U R                   R                  U R                  SU5      $ )z*Return the type of the menu item at INDEX.r(   r  r  s     r   r(   	Menu.type  s    ww||DGGVU33r   c                 P    U R                   R                  U R                  S5        g)zUnmap a menu.unpostNr  rN   s    r   rn  Menu.unpost  r  r   c                     U R                   R                  U R                   R                  U R                  SU5      5      $ )zFReturn the x-position of the leftmost pixel of the menu item
at INDEX.	xpositionrq  r  s     r   rq  Menu.xposition  s,     ww~~dggll477KGHHr   c                     U R                   R                  U R                   R                  U R                  SU5      5      $ )zEReturn the y-position of the topmost pixel of the menu item at INDEX.	ypositionrq  r  s     r   rt  Menu.yposition  s1    ww~~dggllGG[%) * 	*r   r!   r   r+  ) rR   rS   rT   rU   r   r  r(  r  r8  r1  r5  r9  r=  rA  rJ  rG  rK  rO  rR  rU  r(  rY  rb  rX  r  r  ri  r(   rn  rq  rt  rV   r!   r   r   r#  r#    s    Z" 771 !# )
 ! ' #% + ! ' #% + !# ) +- )
 )+ 1 -/ 5 )+ 1 -/ 5 +- 38 GC !K@
6
,4(I
*r   r#  c                   &    \ rS rSrSrS0 4S jrSrg)
Menubuttoni   z(Menubutton widget, obsolete since Tk8.0.Nc                 2    [         R                  XSX#5        g )N
menubuttonr  r  s       r   r  Menubutton.__init__#  s    lC<r   r!   r  r!   r   r   rx  rx     s    2" =r   rx  c                   &    \ rS rSrSrS0 4S jrSrg)Messagei'  zKMessage widget to display multiline text. Obsolete since Label does it too.Nc                 2    [         R                  XSX#5        g )Nmessager  r  s       r   r  Message.__init__*  s    i9r   r!   r  r!   r   r   r}  r}  '  s    U" :r   r}  c                   >    \ rS rSrSrS0 4S jrS rS rS rS r	S	r
g)
Radiobuttoni.  zGRadiobutton widget which shows only one of several buttons in on-state.Nc                 2    [         R                  XSX#5        g)a  Construct a radiobutton widget with the parent MASTER.

Valid option names: activebackground, activeforeground, anchor,
background, bd, bg, bitmap, borderwidth, command, cursor,
disabledforeground, fg, font, foreground, height,
highlightbackground, highlightcolor, highlightthickness, image,
indicatoron, justify, padx, pady, relief, selectcolor, selectimage,
state, takefocus, text, textvariable, underline, value, variable,
width, wraplength.r<  Nr  r  s       r   r  Radiobutton.__init__1  r  r   c                 P    U R                   R                  U R                  S5        gr  r  rN   s    r   r  Radiobutton.deselect=  s     	TWWj)r   c                 P    U R                   R                  U R                  S5        gr  r  rN   s    r   r  Radiobutton.flashB  r  r   c                 N    U R                   R                  U R                  S5      $ r  r  rN   s    r   r  Radiobutton.invokeF  r  r   c                 P    U R                   R                  U R                  S5        gr  r  rN   s    r   rr  Radiobutton.selectJ  r  r   r!   )rR   rS   rT   rU   r   r  r  r  r  rr  rV   r!   r   r   r  r  .  s#    Q" 
>*
'/(r   r  c                   B    \ rS rSrSrS0 4S jrS rS rS
S jrS r	S	r
g)ScaleiO  z1Scale widget which can display a numerical scale.Nc                 2    [         R                  XSX#5        g)a  Construct a scale widget with the parent MASTER.

Valid option names: activebackground, background, bigincrement, bd,
bg, borderwidth, command, cursor, digits, fg, font, foreground, from,
highlightbackground, highlightcolor, highlightthickness, label,
length, orient, relief, repeatdelay, repeatinterval, resolution,
showvalue, sliderlength, sliderrelief, state, takefocus,
tickinterval, to, troughcolor, variable, width.rc  Nr  r  s       r   r  Scale.__init__R  s     	gs7r   c                     U R                   R                  U R                  S5      n U R                   R                  U5      $ ! [        [
        [        4 a    U R                   R                  U5      s $ f = f)z*Get the current value as integer or float.r(  )r<   r  r  ri  r  r+   r   rj  r#  s     r   r(  	Scale.get]  s]    TWWe,	,77>>%((Ix0 	,77$$U++	,s   A 0A65A6c                 R    U R                   R                  U R                  SU5        g)zSet the value to VALUE.r$  Nr  r#  s     r   r$  	Scale.sete  r
  r   c                 n    U R                  U R                  R                  U R                  SU5      5      $ )zReturn a tuple (X,Y) of the point along the centerline of the
trough that corresponds to VALUE or the current value if None is
given.r  r  r#  s     r   r  Scale.coordsi  s(    
 }}TWW\\$''8UCDDr   c                 P    U R                   R                  U R                  SX5      $ )z[Return where the point X,Y lies. Valid return values are "slider",
"though1" and "though2".identifyr  r  s      r   r  Scale.identifyp       ww||DGGZ66r   r!   r+  )rR   rS   rT   rU   r   r  r(  r$  r  r  rV   r!   r   r   r  r  O  s$    ;" 	8,,E7r   r  c                   N    \ rS rSrSrS0 4S jrSS jrS rS rS r	S	 r
S
 rSrg)	Scrollbariv  z?Scrollbar widget which displays a slider at a certain position.Nc                 2    [         R                  XSX#5        g)a:  Construct a scrollbar widget with the parent MASTER.

Valid option names: activebackground, activerelief,
background, bd, bg, borderwidth, command, cursor,
elementborderwidth, highlightbackground,
highlightcolor, highlightthickness, jump, orient,
relief, repeatdelay, repeatinterval, takefocus,
troughcolor, width.	scrollbarNr  r  s       r   r  Scrollbar.__init__y  s     	k3;r   c                 b    U R                   R                  U R                  SU5      =(       d    S$ )aX  Marks the element indicated by index as active.
The only index values understood by this method are "arrow1",
"slider", or "arrow2".  If any other value is specified then no
element of the scrollbar will be active.  If index is not specified,
the method returns the name of the element that is currently active,
or None if no element is active.r  Nr  r  s     r   r  Scrollbar.activate  s$     ww||DGGZ7?4?r   c                     U R                   R                  U R                   R                  U R                  SX5      5      $ )zfReturn the fractional change of the scrollbar setting if it
would be moved by DELTAX or DELTAY pixels.r   r  )rO   deltaxdeltays      r   r   Scrollbar.delta  s3     ww  GGLL'6:< 	<r   c                     U R                   R                  U R                   R                  U R                  SX5      5      $ )zJReturn the fractional value which corresponds to a slider
position of X,Y.re  r  r  s      r   re  Scrollbar.fraction  s.     ww  dggz1!HIIr   c                 P    U R                   R                  U R                  SX5      $ )zQReturn the element under position X,Y as one of
"arrow1","slider","arrow2" or "".r  r  r  s      r   r  Scrollbar.identify  r  r   c                 l    U R                  U R                  R                  U R                  S5      5      $ )zRReturn the current fractional values (upper and lower end)
of the slider position.r(  )r  r<   r  r  rN   s    r   r(  Scrollbar.get  s(     TWWe <==r   c                 R    U R                   R                  U R                  SX5        g)zaSet the fractional values of the slider position (upper and
lower ends as value between 0 and 1).r$  Nr  r  s      r   r$  Scrollbar.set  s     	TWWeU1r   r!   r+  )rR   rS   rT   rU   r   r  r  r   re  r  r(  r$  rV   r!   r   r   r  r  v  s/    I" 	<@<J
7
>
2r   r  c                      \ rS rSrSrS0 4S jrS rS rSS.S	 jrS<S
 jr	S<S jr
S rS=S jrS rS<S jrS rS rS rS rS<S jrS rS<S jr0 4S jrS rS rS rS<S jrS rS rS rS rS  r0 4S! jr S" r!S# r"S$ r#S% r$   S>S& jr%S' r&S( r'S<S) jr(S<S* jr)S?S+ jr*S, r+S<S- jr,\,r-S. r.S<S/ jr/S<S0 jr0S<S1 jr1S<S2 jr2S<S3 jr3S4 r4S<S5 jr5S6 r6S<S7 jr7\7r80 4S8 jr9S9 r:S: r;S;r<g)@Texti  z4Text widget which can display text in various forms.Nc                 2    [         R                  XSX#5        g)a<  Construct a text widget with the parent MASTER.

STANDARD OPTIONS

    background, borderwidth, cursor,
    exportselection, font, foreground,
    highlightbackground, highlightcolor,
    highlightthickness, insertbackground,
    insertborderwidth, insertofftime,
    insertontime, insertwidth, padx, pady,
    relief, selectbackground,
    selectborderwidth, selectforeground,
    setgrid, takefocus,
    xscrollcommand, yscrollcommand,

WIDGET-SPECIFIC OPTIONS

    autoseparators, height, maxundo,
    spacing1, spacing2, spacing3,
    state, tabs, undo, width, wrap,

r  Nr  r  s       r   r  Text.__init__  s    . 	fc6r   c                     U R                  U R                  R                  U R                  SU5      5      =(       d    S$ )zzReturn a tuple of (x,y,width,height) which gives the bounding
box of the visible part of the character at the given index.r  Nr  r  s     r   r  	Text.bbox  s5     }}TWWfe46 >9=	>r   c           	          U R                   R                  U R                   R                  U R                  SXU5      5      $ )zxReturn whether between index INDEX1 and index INDEX2 the
relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.comparer	  )rO   rZ  opr[  s       r   r  Text.compare  s7     ww!!$'',,GGYF#4 5 	5r   F)return_intsc                L   U Vs/ s H  nSU-  PM
     nnU R                   R                  " U R                  S/UQUPUP76 n[        U[        5      (       d$  U R                  U5      n[        U5      S:X  a  Uu  nU(       d  U(       d  SnU$ [        U5      S::  a  U4nU$ s  snf )a
  Counts the number of relevant things between the two indices.

If INDEX1 is after INDEX2, the result will be a negative number
(and this holds for each of the possible options).

The actual items which are counted depends on the options given.
The result is a tuple of integers, one for the result of each
counting option given, if more than one option is specified or
return_ints is false (default), otherwise it is an integer.
Valid counting options are "chars", "displaychars",
"displayindices", "displaylines", "indices", "lines", "xpixels"
and "ypixels". The default value, if no option is specified, is
"indices". There is an additional possible option "update",
which if given then all subsequent options ensure that any
possible out of date information is recalculated.
r-  r  r   N)r<   r  r  r   r_   r  r   )rO   rZ  r[  r  r  argr$   s          r   r  
Text.count  s    " +22'353;'2ggll477GFgFvFvF#s##--$C3x1} 
 W"f
 3s   B!c                     Uc?  U R                   R                  U R                   R                  U R                  S5      5      $ U R                   R                  U R                  SU5        g)zbTurn on the internal consistency checks of the B-Tree inside the text
widget according to BOOLEAN.Ndebugr	  r  s     r   r  
Text.debug  sI     ?77%%dggll477G&DEETWWgw/r   c                 R    U R                   R                  U R                  SX5        g)z?Delete the characters between INDEX1 and INDEX2 (not included).r(  Nr  rO   rZ  r[  s      r   r(  Text.delete  s    TWWh7r   c                 n    U R                  U R                  R                  U R                  SU5      5      $ )zReturn tuple (x,y,width,height,baseline) giving the bounding box
and baseline position of the visible part of the line containing
the character at INDEX.	dlineinfor  r  s     r   r  Text.dlineinfo  s(     }}TWW\\$'';FGGr   c                    / nSnSnU(       d
  / nU4S jnUn [        U[        5      (       d  U R                  U5      =pcUSU/-  nU H"  n	XI   (       d  M  UR                  SU	-   5        M$     UR                  U5        U(       a  UR                  U5        U R                  R
                  " U R                  S/UQ76   UU(       a  U R                  U5        $ $ ! U(       a  U R                  U5        f f = f)aN  Return the contents of the widget between index1 and index2.

The type of contents returned in filtered based on the keyword
parameters; if 'all', 'image', 'mark', 'tag', 'text', or 'window' are
given and true, then the corresponding items are returned. The result
is a list of triples of the form (key, value, index). If none of the
keywords are true then 'all' is used by default.

If the 'command' argument is given, it is called once for each element
of the list of triples, with the values of each triple serving as the
arguments to the function. In this case the list is not returned.Nc                 *    UR                  XU45        g r+  )r   )rA   r   r  rx  s       r   append_triple Text.dump.<locals>.append_triple  s    s512r   z-commandr7   dump)r   r   r4  r   r<   r  r  r  )
rO   rZ  r[  rG  r  r  	func_namerx  r  rA   s
             r   r  	Text.dump  s     	
 F8> 3#G	.gs++&*nnW&==	Z))D77DKKc	2 KKF#GGLL&040""9- y""9- s   :C A*C C6c                 R    U R                   R                  " U R                  S/UQ76 $ )a2  Internal method

This method controls the undo mechanism and
the modified flag. The exact behavior of the
command depends on the option argument that
follows the edit argument. The following forms
of the command are currently supported:

edit_modified, edit_redo, edit_reset, edit_separator
and edit_undo

editr  rW  s     r   r  	Text.edit'  s"     ww||DGGV3d33r   c                 &    U R                  SU5      $ )a  Get or Set the modified flag

If arg is not specified, returns the modified
flag of the widget. The insert, delete, edit undo and
edit redo commands or the user can set or clear the
modified flag. If boolean is specified, sets the
modified flag of the widget to arg.
modifiedr  )rO   r  s     r   edit_modifiedText.edit_modified6  s     yyS))r   c                 $    U R                  S5      $ )zRedo the last undone edit

When the undo option is true, reapplies the last
undone edits provided no other edits were done since
then. Generates an error when the redo stack is empty.
Does nothing when the undo option is false.
redor  rN   s    r   	edit_redoText.edit_redoA  s     yy  r   c                 $    U R                  S5      $ )z(Clears the undo and redo stacks
        resetr  rN   s    r   
edit_resetText.edit_resetK  s     yy!!r   c                 $    U R                  S5      $ )z^Inserts a separator (boundary) on the undo stack.

Does nothing when the undo option is false
r@  r  rN   s    r   edit_separatorText.edit_separatorP  s    
 yy%%r   c                 $    U R                  S5      $ )a  Undoes the last edit action

If the undo option is true. An edit action is defined
as all the insert and delete commands that are recorded
on the undo stack in between two separators. Generates
an error when the undo stack is empty. Does nothing
when the undo option is false
undor  rN   s    r   	edit_undoText.edit_undoW  s     yy  r   c                 P    U R                   R                  U R                  SX5      $ )z5Return the text from INDEX1 to INDEX2 (not included).r(  r  r  s      r   r(  Text.getb  s    ww||DGGUF;;r   c                     USS S:w  a  SU-   nUSS S:X  a  USS nU R                   R                  U R                  SSX5      $ )z9Return the value of OPTION of an embedded image at INDEX.Nr   r7   r  r  r4  r  r  r  s      r   
image_cgetText.image_cgetg  sO    "1:6\F"#;#CR[Fww||DGGWfeDDr   c                 ,    U R                  SSU4X#5      $ )zQuery or modify the configuration options of an embedded image at INDEX.

Similar to configure() except that it applies to the specified
embedded image.
r4  r  r  r
  s       r   image_configureText.image_configureo  s     e<cFFr   c                 t    U R                   R                  " U R                  SSU/U R                  X#5      Q76 $ )z"Create an embedded image at INDEX.r4  r  r  r
  s       r   image_createText.image_createw  s5    ww||'8U*--(* 	*r   c                 P    U R                   R                  U R                  SS5      $ )z3Return all names of embedded images in this widget.r4  r5  r  rN   s    r   r6  Text.image_names}  s    ww||DGGWg66r   c                 b    [        U R                  R                  U R                  SU5      5      $ )z1Return the index in the form line.char for INDEX.r  )r   r<   r  r  r  s     r   r  
Text.index  s"    477<<%899r   c                 Z    U R                   R                  U R                  SX4U-   5        g)zInsert CHARS before the characters at INDEX. An additional
tag can be given in ARGS. Additional CHARS and tags can follow in ARGS.rJ  Nr  )rO   r  charsr  s       r   rJ  Text.insert  s$     	dggx6=>r   c                 T    U R                   R                  U R                  SSX45      $ )z|Change the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT).
Return the current value if None is given for DIRECTION.rh  gravityr  )rO   markName	directions      r   mark_gravityText.mark_gravity  s)     ww||WWfi=? 	?r   c                     U R                   R                  U R                   R                  U R                  SS5      5      $ )zReturn all mark names.rh  r5  rJ  rN   s    r   
mark_namesText.mark_names  s3    ww  GGVW"& ' 	'r   c                 T    U R                   R                  U R                  SSX5        g)z0Set mark MARKNAME before the character at INDEX.rh  r$  Nr  )rO   r  r  s      r   mark_setText.mark_set  s    TWWfeX=r   c                 Z    U R                   R                  U R                  SS4U-   5        g)zDelete all marks in MARKNAMES.rh  unsetNr  )rO   	markNamess     r   
mark_unsetText.mark_unset  s"    dggvw/);<r   c                 d    U R                   R                  U R                  SSU5      =(       d    S$ )z-Return the name of the next mark after INDEX.rh  nextNr  r  s     r   	mark_nextText.mark_next  s$    ww||DGGVVU;CtCr   c                 d    U R                   R                  U R                  SSU5      =(       d    S$ )z2Return the name of the previous mark before INDEX.rh  previousNr  r  s     r   mark_previousText.mark_previous  s$    ww||DGGVZ?G4Gr   c                 v    U R                   R                  " U R                  SSU/U R                  X#5      Q76   g)zCreates a peer text widget with the given newPathName, and any
optional standard configuration options. By default the peer will
have the same start and end line as the parent widget, but
these can be overridden with the standard configuration options.peerr  Nr  )rO   newPathNamer/   r  s       r   peer_createText.peer_create  s1    
 	TWWfh 	%]]3#	%r   c                     U R                   R                  U R                   R                  U R                  SS5      5      $ )zQReturns a list of peers of this widget (this does not include
the widget itself).r  r5  rJ  rN   s    r   
peer_namesText.peer_names  s.     ww  dggvw!GHHr   c                 X    U R                   R                  " U R                  SXU/UQ76   g)zReplaces the range of characters between index1 and index2 with
the given characters and tags specified by args.

See the method insert for some more information about args, and the
method delete for information about the indices.r   Nr  )rO   rZ  r[  r  r  s        r   r   Text.replace  s#     	TWWiFFr   c                 T    U R                   R                  U R                  SSX5        grf  r  r  s      r   ri  Text.scan_mark  rk  r   c                 T    U R                   R                  U R                  SSX5        g)znAdjust the view of the text to 10 times the
difference between X and Y and the coordinates given in
scan_mark.rg  rm  Nr  r  s      r   ro  Text.scan_dragto  r  r   c                    U R                   S/nU(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U(       a  UR                  S5        U
(       a  UR                  S5        U	(       a"  UR                  S5        UR                  U	5        U(       a  US	   S
:X  a  UR                  S5        UR                  U5        UR                  U5        U(       a  UR                  U5        [        U R                  R	                  [        U5      5      5      $ )z{Search PATTERN beginning from INDEX until STOPINDEX.
Return the index of the first character of a match or an
empty string.r   z	-forwardsz
-backwardsz-exactz-regexpz-nocasez-elidez-countr   r7   r  )r  r   r   r<   r  r   )rO   r  r  	stopindexforwards	backwardsexactregexpnocaser  elider  s               r   r   Text.search  s     "T[[-dkk,/$++h'4;;y)4;;y)$++h'$++h'U);wqzS($++d*;GEdkk),477<<d,--r   c                 R    U R                   R                  U R                  SU5        g)z3Scroll such that the character at INDEX is visible.r  Nr  r  s     r   r  Text.see  r
  r   c                 \    U R                   R                  U R                  SSX4U-   5        g)ztAdd tag TAGNAME to all characters between INDEX1 and index2 in ARGS.
Additional pairs of indices may follow in ARGS.tagr8  Nr  )rO   tagNamerZ  r  s       r   tag_addText.tag_add  s)     	WWeUG4t;	=r   c                 B    U R                  U R                  SSX4U5      $ )z_Unbind for all characters with TAGNAME for event SEQUENCE  the
function identified with FUNCID.r(  rX  r]  )rO   r)  rR  rT  s       r   r  Text.tag_unbind  s"     ||TWWeVWGPPr   c                 D    U R                  U R                  SSU4X#U5      $ )a  Bind to all characters with TAGNAME at event SEQUENCE a call to function FUNC.

An additional boolean parameter ADD specifies whether FUNC will be
called additionally to the other bound function or whether it will
replace the previous function. See bind for the return value.r(  rX  rY  rO   r)  rR  r  r8  s        r   r  Text.tag_bind  s)     zz477E67;#' 	'r   c                 D    U R                  U R                  SSU4X#U5      $ )Nr(  rX  rY  r/  s        r   	_tag_bindText._tag_bind  s'    zz477E67;#' 	'r   c                     USS S:w  a  SU-   nUSS S:X  a  USS nU R                   R                  U R                  SSX5      $ )z+Return the value of OPTION for tag TAGNAME.Nr   r7   r  r  r(  r  r  )rO   r)  r  s      r   tag_cgetText.tag_cget  sO    "1:6\F"#;#CR[Fww||DGGUFGDDr   c                 ,    U R                  SSU4X#5      $ )zQuery or modify the configuration options of a tag TAGNAME.

Similar to configure() except that it applies to the specified tag.
r(  r  r  )rO   r)  r/   r  s       r   tag_configureText.tag_configure  s    
 {G<cFFr   c                 Z    U R                   R                  U R                  SS4U-   5        g)zDelete all tags in TAGNAMES.r(  r(  Nr  )rO   tagNamess     r   
tag_deleteText.tag_delete  s"    dgguh/(:;r   c                 T    U R                   R                  U R                  SSX5        g)zXChange the priority of tag TAGNAME such that it is lower
than the priority of BELOWTHIS.r(  rX  Nr  )rO   r)  rY  s      r   rT  Text.tag_lower
  s     	TWWeWgAr   c                     U R                   R                  U R                   R                  U R                  SSU5      5      $ )zReturn a list of all tag names.r(  r5  rJ  r  s     r   	tag_namesText.tag_names  s3    ww  GGLL%%8: 	:r   c           
          U R                   R                  U R                   R                  U R                  SSXU5      5      $ )zReturn a list of start and end index for the first sequence of
characters between INDEX1 and INDEX2 which all have tag TAGNAME.
The text is searched forward from INDEX1.r(  	nextrangerJ  rO   r)  rZ  r[  s       r   tag_nextrangeText.tag_nextrange  <     ww  GGUK&"B C 	Cr   c           
          U R                   R                  U R                   R                  U R                  SSXU5      5      $ )zReturn a list of start and end index for the first sequence of
characters between INDEX1 and INDEX2 which all have tag TAGNAME.
The text is searched backwards from INDEX1.r(  	prevrangerJ  rE  s       r   tag_prevrangeText.tag_prevrange  rH  r   c                 T    U R                   R                  U R                  SSX5        g)zYChange the priority of tag TAGNAME such that it is higher
than the priority of ABOVETHIS.r(  r]  Nr  )rO   r)  r^  s      r   r`  Text.tag_raise"  s!     	GGUGW	9r   c                     U R                   R                  U R                   R                  U R                  SSU5      5      $ )z7Return a list of ranges of text which have tag TAGNAME.r(  rangesrJ  )rO   r)  s     r   
tag_rangesText.tag_ranges(  s5    ww  GGUHg"/ 0 	0r   c                 V    U R                   R                  U R                  SSXU5        g)zARemove tag TAGNAME from all characters between INDEX1 and INDEX2.r(  r@  Nr  rE  s       r   
tag_removeText.tag_remove-  s!    GGUHgv	?r   c                     USS S:w  a  SU-   nUSS S:X  a  USS nU R                   R                  U R                  SSX5      $ )z:Return the value of OPTION of an embedded window at INDEX.Nr   r7   r  r  r  r  r  r  s      r   window_cgetText.window_cget2  sO    "1:6\F"#;#CR[Fww||DGGXvuEEr   c                 ,    U R                  SSU4X#5      $ )zQuery or modify the configuration options of an embedded window at INDEX.

Similar to configure() except that it applies to the specified
embedded window.
r  r  r  r
  s       r   window_configureText.window_configure:  s     +u=sGGr   c                 z    U R                   R                  U R                  SSU4U R                  X#5      -   5        g)zCreate a window at INDEX.r  r  Nr  r
  s       r   window_createText.window_createD  s3    ww(E2c&'	(r   c                     U R                   R                  U R                   R                  U R                  SS5      5      $ )z4Return all names of embedded windows in this widget.r  r5  rJ  rN   s    r   window_namesText.window_namesJ  s1    ww  GGLL(G46 	6r   c                 Z    U R                   R                  U R                  SS4U-   5        g)zObsolete function, use see.rs  z
-pickplaceNr  )rO   r   s     r   yview_pickplaceText.yview_pickplaceO  s"    dggw5<=r   r!   r+  rA  )NNNNNNNNrZ  )=rR   rS   rT   rU   r   r  r  r  r  r  r(  r  r  r  r  r  r  r  r  r(  r  r  r  r6  r  rJ  r  r  r  r  r  r  r  r  r   ri  ro  r   r  r*  r  r  r2  r5  r8  
tag_configr<  rT  rA  rF  rK  r`  rQ  rT  rW  rZ  window_configr]  r`  rc  rV   r!   r   r   r  r    sO   >" 72>5 ;@ <08H%.P4	*!"
&	!<
EG ') *7:?
?'
>=DH ,. %I
G46 04047;.(,=Q
''
EG J<B
:
CC90
?
FH %M') (6
>r   r  c                   (    \ rS rSrSrSS jrS rSrg)_setitiT  z>Internal class. It wraps the command in the widget OptionMenu.Nc                 (    X l         Xl        X0l        g r+  )_setit__value_setit__var_setit__callback)rO   varr   r1  s       r   r  _setit.__init__W  s    
"r   c                     U R                   R                  U R                  5        U R                  b  U R                  " U R                  /UQ76   g g r+  )rk  r$  rj  rl  rW  s     r   r-  _setit.__call__\  s:    

t||$??&OODLL040 'r   )
__callback__value__varr+  rY  r!   r   r   rh  rh  T  s    H#
1r   rh  c                   *    \ rS rSrSrS rS rS rSrg)
OptionMenuib  z?OptionMenu which allows the user to select a value from a menu.c           	         SUS[         SSS.n[        R                  XSU5        SU l        [	        U SSS	9=opl        UR                  U l        UR                  S
5      nS
U;   a  US
	 U(       a   [        S[        [        U5      5      -   5      eUR                  U[        X#U5      S9  U H  n	UR                  U	[        X)U5      S9  M     XpS'   g)zConstruct an optionmenu widget with the parent MASTER, with
the option textvariable set to VARIABLE, the initially selected
value VALUE, the other menu values VALUES and an additional
keyword argument command.r6   r   r0   )borderwidthtextvariableindicatoronreliefr  highlightthicknessrz  tk_optionMenur%  r   )r   tearoffrG  zunknown option -)r  rG  N)RAISEDr  r  r  r#  _OptionMenu__menur  menunamer(  r   r  r:   r9  rh  )
rO   r   r9  r   r4  r  r  r%  r1  r3   s
             r   r  OptionMenu.__init__e  s    
 &C$%' 	lB7)!$VQ??{::i(y!-d4<.@@AAu: 	 	<A1#H:  <  Vr   c                 P    US:X  a  U R                   $ [        R                  X5      $ )Nr%  )r  r  rQ  r  s     r   rQ  OptionMenu.__getitem__~  s$    6>;;!!$--r   c                 <    [         R                  U 5        SU l        g)z,Destroy this widget and the associated menu.N)rx  r   r  rN   s    r   r   OptionMenu.destroy  s    4 r   )__menur  r  N)	rR   rS   rT   rU   r   r  rQ  r   rV   r!   r   r   ru  ru  b  s    I2.
r   ru  c                   `    \ rS rSrSrSrS0 S4S jrS rS rS r	S	 r
S
 r\rS rS rS rSrg)Imagei  zBase class for images.r   Nc                    S U l         Uc  [        S5      n[        USU5      U l        U(       d-  [        =R
                  S-  sl        S[        R
                  < 3nU(       a  U(       a  [        X545      nO	U(       a  UnSnUR                  5        H  u  pxUSU-   U4-   nM     U R                  R                  SSX4U-   5        X l         g )	Nzcreate imager<   r   pyimager!   r7   r4  r  )	r   r   r   r<   r  _last_idr4   r-   r  )	rO   imgtyper   r/   r   r  r  r2   r3   s	            r   r  Image.__init__  s    	>&~6F&$/NNaN"'..2D#Yy1srIIKDAQ
*G  gx87BC	r   c                     U R                   $ r+  )r   rN   s    r   rP   Image.__str__  s    dii'r   c                     U R                   (       a)   U R                  R                  SSU R                   5        g g ! [         a     g f = f)Nr4  r(  )r   r<   r  r   rN   s    r   r  Image.__del__  s?    99Wh		:   s   '< 
A	A	c                 Z    U R                   R                  U R                  SSU-   U5        g Nr  r7   r<   r  r   r  s      r   r  Image.__setitem__  s     TYYSWe<r   c                 V    U R                   R                  U R                  SSU-   5      $ r  r  r  s     r   rQ  Image.__getitem__  s!    ww||DII{CG<<r   c                     Sn[        U5      R                  5        H"  u  p4Uc  M
  US   S:X  a  USS nUSU-   U4-   nM$     U R                  R                  U R                  S4U-   5        g)zConfigure the image.r!   Nr  r  r7   rP  )r4   r-   r<   r  r   )rO   r  r$   r2   r3   s        r   r  Image.configure  sl    bM'')DA}R5C<QsVSUAJ& * 	dii*S01r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zReturn the height of the image.r4  r   r<   ri  r  r   rN   s    r   r   Image.height  s/    ww~~GGLL(DII68 	8r   c                 P    U R                   R                  SSU R                  5      $ )z7Return the type of the image, e.g. "photo" or "bitmap".r4  r(   r  rN   s    r   r(   
Image.type  s    ww||GVTYY77r   c                     U R                   R                  U R                   R                  SSU R                  5      5      $ )zReturn the width of the image.r4  r   r  rN   s    r   r   Image.width  s/    ww~~GGLL'49957 	7r   )r   r<   )rR   rS   rT   rU   r   r  r  rP   r  r  rQ  r  rP  r   r(   r   rV   r!   r   r   r  r    sE     H%)r$   (==2 F8
87r   r  c                       \ rS rSrSrS0 S4S jrS rS rS rSSSS.S	 jr	SSS
.S jjr
SSS
.S jjrSSSSSSS.S jrS rSS jrSSSSS.S jjrSSSS.S jjrSSSSS.S jjrS rS rSrg)
PhotoImagei  z=Widget which can display images in PGM, PPM, GIF, PNG format.Nc                 8    [         R                  " U SXU40 UD6  g)zbCreate an image with NAME.

Valid option names: data, format, file, gamma, height, palette,
width.photoNr  r  rO   r   r/   r   r  s        r   r  PhotoImage.__init__  s    
 	tWd>2>r   c                 P    U R                   R                  U R                  S5        g)zDisplay a transparent image.blankNr  rN   s    r   r  PhotoImage.blank  s    TYY(r   c                 V    U R                   R                  U R                  SSU-   5      $ )zReturn the value of OPTION.r  r7   r  r  s     r   r  PhotoImage.cget  s!    ww||DIIvsV|<<r   c                 V    U R                   R                  U R                  SSU-   5      $ )Nr  r7   r  r  s     r   rQ  PhotoImage.__getitem__  s!    ww||DIIvsSy99r   from_coordszoom	subsamplec                L    [        U R                  S9nUR                  XX#S9  U$ )a  Return a new PhotoImage with the same image as this widget.

The FROM_COORDS option specifies a rectangular sub-region of the
source image to be copied. It must be a tuple or a list of 1 to 4
integers (x1, y1, x2, y2).  (x1, y1) and (x2, y2) specify diagonally
opposite corners of the rectangle.  If x2 and y2 are not specified,
the default value is the bottom-right corner of the source image.
The pixels copied will include the left and top edges of the
specified rectangle but not the bottom or right edges.  If the
FROM_COORDS option is not given, the default is the whole source
image.

If SUBSAMPLE or ZOOM are specified, the image is transformed as in
the subsample() or zoom() methods.  The value must be a single
integer or a pair of integers.
r   r  )r  r<   copy_replace)rO   r  r  r  	destImages        r   copyPhotoImage.copy  s0    " dgg.	t$( 	 	?r   )r  c                4    US:X  a  UnU R                  X4US9$ )a5  Return a new PhotoImage with the same image as this widget
but zoom it with a factor of X in the X direction and Y in the Y
direction.  If Y is not given, the default value is the same as X.

The FROM_COORDS option specifies a rectangular sub-region of the
source image to be copied, as in the copy() method.
r   )r  r  r  rO   r   r   r  s       r   r  PhotoImage.zoom  s$     b5A!yyqf+y>>r   c                4    US:X  a  UnU R                  X4US9$ )a  Return a new PhotoImage based on the same image as this widget
but use only every Xth or Yth pixel.  If Y is not given, the
default value is the same as X.

The FROM_COORDS option specifies a rectangular sub-region of the
source image to be copied, as in the copy() method.
r   )r  r  r  r  s       r   r  PhotoImage.subsample  s$     b5A!yyA6{yCCr   F)r  r  shrinkr  r  compositingrulec                   / nUb  UR                  S/UQ75        Ub  UR                  S/UQ75        U(       a  UR                  S5        Ub3  [        U[        [        45      (       d  U4nUR                  S/UQ75        Ub3  [        U[        [        45      (       d  U4nUR                  S/UQ75        U(       a  UR                  SU45        U R
                  R                  " U R                  SU/UQ76   g)	a[  Copy a region from the source image (which must be a PhotoImage) to
this image, possibly with pixel zooming and/or subsampling.  If no
options are specified, this command copies the whole of the source
image into this image, starting at coordinates (0, 0).

The FROM_COORDS option specifies a rectangular sub-region of the
source image to be copied. It must be a tuple or a list of 1 to 4
integers (x1, y1, x2, y2).  (x1, y1) and (x2, y2) specify diagonally
opposite corners of the rectangle.  If x2 and y2 are not specified,
the default value is the bottom-right corner of the source image.
The pixels copied will include the left and top edges of the
specified rectangle but not the bottom or right edges.  If the
FROM_COORDS option is not given, the default is the whole source
image.

The TO option specifies a rectangular sub-region of the destination
image to be affected.  It must be a tuple or a list of 1 to 4
integers (x1, y1, x2, y2).  (x1, y1) and (x2, y2) specify diagonally
opposite corners of the rectangle.  If x2 and y2 are not specified,
the default value is (x1,y1) plus the size of the source region
(after subsampling and zooming, if specified).  If x2 and y2 are
specified, the source region will be replicated if necessary to fill
the destination region in a tiled fashion.

If SHRINK is true, the size of the destination image should be
reduced, if necessary, so that the region being copied into is at
the bottom-right corner of the image.

If SUBSAMPLE or ZOOM are specified, the image is transformed as in
the subsample() or zoom() methods.  The value must be a single
integer or a pair of integers.

The COMPOSITINGRULE option specifies how transparent pixels in the
source image are combined with the destination image.  When a
compositing rule of 'overlay' is set, the old contents of the
destination image are visible, as if the source image were printed
on a piece of transparent film and placed over the top of the
destination.  When a compositing rule of 'set' is set, the old
contents of the destination image are discarded and the source image
is used as-is.  The default compositing rule is 'overlay'.
N-from-to-shrinkz-zoomz
-subsamplez-compositingruler  )extendr   r   r   r   r<   r  r   )	rO   sourceImager  r  r  r  r  r  r  s	            r   r  PhotoImage.copy_replace	  s    V "NNG2k23>NNE<B<(NN9%dUDM22wNNG+d+, i%77&L	NNL5956NN.@ATYY>g>r   c                 P    U R                   R                  U R                  SX5      $ )z8Return the color (red, green, blue) of the pixel at X,Y.r(  r  r  s      r   r(  PhotoImage.getG  s    ww||DIIua33r   c                     U R                   SU4nU(       a  US   S:X  a  USS nUS-   [        U5      -   nU R                  R                  U5        g)zrPut row formatted colors to image starting from
position TO, e.g. image.put("{red green} {blue yellow}", to=(4,6))putr   r  r   N)r  )r   r   r<   r  )rO   r  r  r  s       r   r  PhotoImage.putK  sO     		5$'!u~V(?U2Y.DTr   )r  r  r  c                    SnUb  USU4-  nUb	  US/UQ7-  nU(       a  US-  nUb	  US/UQ7-  nU R                   R                  " U R                  SU/UQ76   g)a  Reads image data from the file named FILENAME into the image.

The FORMAT option specifies the format of the image data in the
file.

The FROM_COORDS option specifies a rectangular sub-region of the image
file data to be copied to the destination image.  It must be a tuple
or a list of 1 to 4 integers (x1, y1, x2, y2).  (x1, y1) and
(x2, y2) specify diagonally opposite corners of the rectangle.  If
x2 and y2 are not specified, the default value is the bottom-right
corner of the source image.  The default, if this option is not
specified, is the whole of the image in the image file.

The TO option specifies the coordinates of the top-left corner of
the region of the image into which data from filename are to be
read.  The default is (0, 0).

If SHRINK is true, the size of the destination image will be
reduced, if necessary, so that the region into which the image file
data are read is at the bottom-right corner of the image.
r!   N-formatr  )r  r  r?  r  )rO   filenameformatr  r  r  r  s          r   r?  PhotoImage.readU  su    , 	6**G".+..G|#G>||#GTYY;7;r   )
background	grayscalec                    SnUb  USU4-  nUb	  US/UQ7-  nU(       a  US-  nUb  USU4-  nU R                   R                  " U R                  SU/UQ76   g)a  Writes image data from the image to a file named FILENAME.

The FORMAT option specifies the name of the image file format
handler to be used to write the data to the file.  If this option
is not given, the format is guessed from the file extension.

The FROM_COORDS option specifies a rectangular region of the image
to be written to the image file.  It must be a tuple or a list of 1
to 4 integers (x1, y1, x2, y2).  If only x1 and y1 are specified,
the region extends from (x1,y1) to the bottom-right corner of the
image.  If all four coordinates are given, they specify diagonally
opposite corners of the rectangular region.  The default, if this
option is not given, is the whole image.

If BACKGROUND is specified, the data will not contain any
transparency information.  In all transparent pixels the color will
be replaced by the specified color.

If GRAYSCALE is true, the data will not contain color information.
All pixel data will be transformed into grayscale.
r!   Nr  r  z
-grayscale-backgroundwriter  )rO   r  r  r  r  r  r  s          r   r  PhotoImage.writev  su    . 	6**G".+..G&G!z22GTYY<G<r   )r  r  r  c                4   SnUb  USU4-  nUb	  US/UQ7-  nU(       a  US-  nUb  USU4-  nU R                   R                  " U R                  S/UQ76 n[        U[        5      (       a,  Uc  U R                   R                  U5      nU$ [        US5      nU$ )u  Returns image data.

The FORMAT option specifies the name of the image file format
handler to be used.  If this option is not given, this method uses
a format that consists of a tuple (one element per row) of strings
containings space separated (one element per pixel/column) colors
in “#RRGGBB” format (where RR is a pair of hexadecimal digits for
the red channel, GG for green, and BB for blue).

The FROM_COORDS option specifies a rectangular region of the image
to be returned.  It must be a tuple or a list of 1 to 4 integers
(x1, y1, x2, y2).  If only x1 and y1 are specified, the region
extends from (x1,y1) to the bottom-right corner of the image.  If
all four coordinates are given, they specify diagonally opposite
corners of the rectangular region, including (x1, y1) and excluding
(x2, y2).  The default, if this option is not given, is the whole
image.

If BACKGROUND is specified, the data will not contain any
transparency information.  In all transparent pixels the color will
be replaced by the specified color.

If GRAYSCALE is true, the data will not contain color information.
All pixel data will be transformed into grayscale.
r!   r  r  r  r  r  r   )r<   r  r   r   r   r8   r   )rO   r  r  r  r  r  r  s          r   r  PhotoImage.data  s    6 	6**G".+..G&G!z22Gww||DIIv88dC  ~ww((.  T8,r   c           	          U R                   R                  U R                   R                  U R                  SSX5      5      $ )z/Return True if the pixel at x,y is transparent.transparencyr(  )r<   r  r  r   r  s      r   transparency_getPhotoImage.transparency_get  s5    ww!!$'',,II~ua#4 5 	5r   c                 V    U R                   R                  U R                  SSXU5        g)z)Set the transparency of the pixel at x,y.r  r$  Nr  )rO   r   r   r  s       r   transparency_setPhotoImage.transparency_set  s    TYYqWEr   r!   rv  r+  rA  )rR   rS   rT   rU   r   r  r  r  rQ  r  r  r  r  r(  r  r?  r  r  r  r  rV   r!   r   r   r  r    s    G b ?)=
: #'TT ,	?4 	?	D 	D 8<U$<?|4<$u <B = =D*t*X5
Fr   r  c                   (    \ rS rSrSrS0 S4S jrSrg)BitmapImagei  z.Widget which can display images in XBM format.Nc                 8    [         R                  " U SXU40 UD6  g)zgCreate a bitmap with NAME.

Valid option names: background, data, file, foreground, maskdata, maskfile.r  Nr  r  s        r   r  BitmapImage.__init__  s     	tXt&?B?r   r!   r  r!   r   r   r  r    s    8 b @r   r  c                  n    [        S5      R                  n U R                  U R                  SS5      5      $ )Nzuse image_names()r4  r5  r   r<   r8   r  r<   s    r   r6  r6    -    	.	/	2	2B<<122r   c                  n    [        S5      R                  n U R                  U R                  SS5      5      $ )Nzuse image_types()r4  r:  r  r  s    r   r;  r;    r  r   c                       \ rS rSrSrS0 4S jrS rSS jrS rS r	S	 r
S
 rS rS rS rS rS rS rS rS rSS jrS rS rS rS rSrg)Spinboxi  zspinbox widget.Nc                 2    [         R                  XSX#5        g)a  Construct a spinbox widget with the parent MASTER.

STANDARD OPTIONS

    activebackground, background, borderwidth,
    cursor, exportselection, font, foreground,
    highlightbackground, highlightcolor,
    highlightthickness, insertbackground,
    insertborderwidth, insertofftime,
    insertontime, insertwidth, justify, relief,
    repeatdelay, repeatinterval,
    selectbackground, selectborderwidth
    selectforeground, takefocus, textvariable
    xscrollcommand.

WIDGET-SPECIFIC OPTIONS

    buttonbackground, buttoncursor,
    buttondownrelief, buttonuprelief,
    command, disabledbackground,
    disabledforeground, format, from,
    invalidcommand, increment,
    readonlybackground, state, to,
    validate, validatecommand values,
    width, wrap,
spinboxNr  r  s       r   r  Spinbox.__init__  s    6 	i9r   c                     U R                  U R                  R                  U R                  SU5      5      =(       d    S$ )a  Return a tuple of X1,Y1,X2,Y2 coordinates for a
rectangle which encloses the character given by index.

The first two elements of the list give the x and y
coordinates of the upper-left corner of the screen
area covered by the character (in pixels relative
to the widget) and the last two elements give the
width and height of the character, in pixels. The
bounding box may refer to a region outside the
visible area of the window.
r  Nr  r  s     r   r  Spinbox.bbox  s-     }}TWW\\$''65ABJdJr   c                 P    U R                   R                  U R                  SX5      $ )a'  Delete one or more elements of the spinbox.

First is the index of the first character to delete,
and last is the index of the character just after
the last one to delete. If last isn't specified it
defaults to first+1, i.e. a single character is
deleted.  This command returns an empty string.
r(  r  r  s      r   r(  Spinbox.delete  s     ww||DGGXu;;r   c                 N    U R                   R                  U R                  S5      $ )zReturns the spinbox's stringr(  r  rN   s    r   r(  Spinbox.get  r  r   c                 P    U R                   R                  U R                  SU5      $ )zAlter the position of the insertion cursor.

The insertion cursor will be displayed just before
the character given by index. Returns an empty string
rE  r  r  s     r   rE  Spinbox.icursor  s     ww||DGGY66r   c                 P    U R                   R                  U R                  SX5      $ )zkReturns the name of the widget at position x, y

Return value is one of: none, buttondown, buttonup, entry
r  r  r  s      r   r  Spinbox.identify'  s    
 ww||DGGZ66r   c                 P    U R                   R                  U R                  SU5      $ )z;Returns the numerical index corresponding to index
        r  r  r  s     r   r  Spinbox.index.  s     ww||DGGWe44r   c                 P    U R                   R                  U R                  SX5      $ )z3Insert string s at index

Returns an empty string.
rJ  r  )rO   r  r   s      r   rJ  Spinbox.insert3  s    
 ww||DGGXu88r   c                 P    U R                   R                  U R                  SU5      $ )zCauses the specified element to be invoked

The element could be buttondown or buttonup
triggering the action associated with it.
r  r  rO   elements     r   r  Spinbox.invoke:  s     ww||DGGXw77r   c                     U R                  U R                  R                  U R                  S4U-   5      5      =(       d    S$ )r   rg  r!   r  rW  s     r   rg  Spinbox.scanB  r%  r   c                 &    U R                  SU5      $ )zRecords x and the current view in the spinbox window;

used in conjunction with later scan dragto commands.
Typically this command is associated with a mouse button
press in the widget. It returns an empty string.
rh  rg  rQ  s     r   ri  Spinbox.scan_markG  s     yy##r   c                 &    U R                  SU5      $ )a|  Compute the difference between the given x argument
and the x argument to the last scan mark command

It then adjusts the view left or right by 10 times the
difference in x-coordinates. This command is typically
associated with mouse motion events in the widget, to
produce the effect of dragging the spinbox at high speed
through the window. The return value is an empty string.
rm  r	  rQ  s     r   ro  Spinbox.scan_dragtoP  s     yy1%%r   c                     U R                  U R                  R                  U R                  S4U-   5      5      =(       d    S$ )r   r?  r!   r  rW  s     r   r?  Spinbox.selection\  s9    }}GGLL$'';/$679 ?<>	?r   c                 &    U R                  SU5      $ )a  Locate the end of the selection nearest to the character
given by index,

Then adjust that end of the selection to be at index
(i.e including but not going beyond index). The other
end of the selection is made the anchor point for future
select to commands. If the selection isn't currently in
the spinbox, then a new selection is created to include
the characters between index and the most recent selection
anchor point, inclusive.
rs  r?  r  s     r   r  Spinbox.selection_adjusta  s     ~~h..r   c                 $    U R                  S5      $ )z[Clear the selection

If the selection isn't in this widget then the
command has no effect.
r  r	  rN   s    r   r@  Spinbox.selection_clearo  s     ~~g&&r   c                 R    U R                   R                  U R                  SSU5      $ )ztSets or gets the currently selected element.

If a spinbutton element is specified, it will be
displayed depressed.
r?  r  r  r  s     r   selection_elementSpinbox.selection_elementw  s!     ww||DGG[)WEEr   c                 (    U R                  SU5        g)r  r|  Nr	  r  s     r   r  Spinbox.selection_from  s    vu%r   c                     U R                   R                  U R                   R                  U R                  SS5      5      $ )zMReturn True if there are characters selected in the spinbox, False
otherwise.r?  r  r	  rN   s    r   r  Spinbox.selection_present  r  r   c                 (    U R                  SX5        g)r  r  Nr	  r  s      r   r  Spinbox.selection_range  s    w+r   c                 (    U R                  SU5        g)r  r  Nr	  r  s     r   r  Spinbox.selection_to  s    tU#r   r!   r+  )rR   rS   rT   rU   r   r  r  r(  r(  rE  r  r  rJ  r  rg  ri  ro  r?  r  r@  r	  r  r  r  r  rV   r!   r   r   r  r    sp    " ::K	<,775
98:
$
&?
/'F&;,$r   r  c                   &    \ rS rSrSrS0 4S jrSrg)
LabelFramei  zlabelframe widget.Nc                 2    [         R                  XSX#5        g)a[  Construct a labelframe widget with the parent MASTER.

STANDARD OPTIONS

    borderwidth, cursor, font, foreground,
    highlightbackground, highlightcolor,
    highlightthickness, padx, pady, relief,
    takefocus, text

WIDGET-SPECIFIC OPTIONS

    background, class, colormap, container,
    height, labelanchor, labelwidget,
    visual, width

labelframeNr  r  s       r   r  LabelFrame.__init__  s      	lC<r   r!   r  r!   r   r   r	  r	    s    " =r   r	  c                       \ rS rSrSrS0 4S jrS rS r\rS r	S r
S	 rS
 rS rS rS rS rS rS rSS jr\rS rSrg)PanedWindowi  zpanedwindow widget.Nc                 2    [         R                  XSX#5        g)a  Construct a panedwindow widget with the parent MASTER.

STANDARD OPTIONS

    background, borderwidth, cursor, height,
    orient, relief, width

WIDGET-SPECIFIC OPTIONS

    handlepad, handlesize, opaqueresize,
    sashcursor, sashpad, sashrelief,
    sashwidth, showhandle,
panedwindowNr  r  s       r   r  PanedWindow.__init__  s     	mS=r   c                 x    U R                   R                  U R                  SU4U R                  U5      -   5        g)a  Add a child widget to the panedwindow in a new pane.

The child argument is the name of the child widget
followed by pairs of arguments that specify how to
manage the windows. The possible options and values
are the ones accepted by the paneconfigure method.
r8  Nr  )rO   ry  r  s      r   r8  PanedWindow.add  s-     	dggue,t}}R/@@Ar   c                 R    U R                   R                  U R                  SU5        g)ztRemove the pane containing child from the panedwindow

All geometry management options for child will be forgotten.
r  Nr  )rO   ry  s     r   r@  PanedWindow.remove  s    
 	TWWh.r   c                 P    U R                   R                  U R                  SX5      $ )a_  Identify the panedwindow component at point x, y

If the point is over a sash or a sash handle, the result
is a two element list containing the index of the sash or
handle, and a word indicating whether it is over a sash
or a handle, such as {0 sash} or {2 handle}. If the point
is over any other part of the panedwindow, the result is
an empty list.
r  r  r  s      r   r  PanedWindow.identify  s     ww||DGGZ66r   c                     U R                  U R                  R                  U R                  S4U-   5      5      =(       d    S$ )r   proxyr!   r  rW  s     r   r+	  PanedWindow.proxy  s9    }}GGLL$''7+d235 ;8:	;r   c                 $    U R                  S5      $ )zBReturn the x and y pair of the most recent proxy location
        coordr+	  rN   s    r   proxy_coordPanedWindow.proxy_coord  s     zz'""r   c                 $    U R                  S5      $ )z+Remove the proxy from the display.
        r  r/	  rN   s    r   proxy_forgetPanedWindow.proxy_forget  s     zz(##r   c                 &    U R                  SX5      $ )z:Place the proxy at the given x and y coordinates.
        r  r/	  r  s      r   proxy_placePanedWindow.proxy_place  s     zz'1((r   c                     U R                  U R                  R                  U R                  S4U-   5      5      =(       d    S$ )r   sashr!   r  rW  s     r   r9	  PanedWindow.sash  r%  r   c                 &    U R                  SU5      $ )a  Return the current x and y pair for the sash given by index.

Index must be an integer between 0 and 1 less than the
number of panes in the panedwindow. The coordinates given are
those of the top left corner of the region containing the sash.
pathName sash dragto index x y This command computes the
difference between the given coordinates and the coordinates
given to the last sash coord command for the given sash. It then
moves that sash the computed difference. The return value is the
empty string.
r.	  r9	  r  s     r   
sash_coordPanedWindow.sash_coord  s     yy%((r   c                 &    U R                  SU5      $ )zoRecords x and y for the sash given by index;

Used in conjunction with later dragto commands to move the sash.
rh  r<	  r  s     r   	sash_markPanedWindow.sash_mark  s    
 yy''r   c                 (    U R                  SXU5      $ )z?Place the sash given by index at the given coordinates
        r  r<	  )rO   r  r   r   s       r   
sash_placePanedWindow.sash_place  s     yy%A..r   c                 `    U R                   R                  U R                  S4USU-   4-   5      $ )z.Return the value of option for a child window.panecgetr7   r  )rO   ry  r  s      r   rF	  PanedWindow.panecget  r  r   c                 @   Uc$  U(       d  U R                  U R                  SU5      $ [        U[        5      (       a(  U(       d!  U R	                  U R                  SUSU-   5      $ U R
                  R                  U R                  SU4U R                  X#5      -   5        g)a
  Query or modify the configuration options for a child window.

Similar to configure() except that it applies to the specified
window.

The following options are supported:

after window
    Insert the window after the window specified. window
    should be the name of a window already managed by pathName.
before window
    Insert the window before the window specified. window
    should be the name of a window already managed by pathName.
height size
    Specify a height for the window. The height will be the
    outer dimension of the window including its border, if
    any. If size is an empty string, or if -height is not
    specified, then the height requested internally by the
    window will be used initially; the height may later be
    adjusted by the movement of sashes in the panedwindow.
    Size may be any value accepted by Tk_GetPixels.
minsize n
    Specifies that the size of the window cannot be made
    less than n. This constraint only affects the size of
    the widget in the paned dimension -- the x dimension
    for horizontal panedwindows, the y dimension for
    vertical panedwindows. May be any value accepted by
    Tk_GetPixels.
padx n
    Specifies a non-negative value indicating how much
    extra space to leave on each side of the window in
    the X-direction. The value may have any of the forms
    accepted by Tk_GetPixels.
pady n
    Specifies a non-negative value indicating how much
    extra space to leave on each side of the window in
    the Y-direction. The value may have any of the forms
    accepted by Tk_GetPixels.
sticky style
    If a window's pane is larger than the requested
    dimensions of the window, this option may be used
    to position (or stretch) the window within its pane.
    Style is a string that contains zero or more of the
    characters n, s, e or w. The string can optionally
    contains spaces or commas, but they are ignored. Each
    letter refers to a side (north, south, east, or west)
    that the window will "stick" to. If both n and s
    (or e and w) are specified, the window will be
    stretched to fill the entire height (or width) of
    its cavity.
width size
    Specify a width for the window. The width will be
    the outer dimension of the window including its
    border, if any. If size is an empty string, or
    if -width is not specified, then the width requested
    internally by the window will be used initially; the
    width may later be adjusted by the movement of sashes
    in the panedwindow. Size may be any value accepted by
    Tk_GetPixels.

Npaneconfigurer7   )r  r  r   r   r  r<   r  r  rQ  s       r   rI	  PanedWindow.paneconfigure  s    | ;r%%dggHHc3&&'3s7< <dgg8s'( 	)r   c                     U R                   R                  U R                   R                  U R                  S5      5      $ )z+Returns an ordered list of the child panes.panesrJ  rN   s    r   rL	  PanedWindow.panes^  s*    ww  dggw!?@@r   r!   r+  )rR   rS   rT   rU   r   r  r8  r@  r  r  r+	  r0	  r3	  r6	  r9	  r=	  r@	  rC	  rF	  rI	  
paneconfigrL	  rV   r!   r   r   r 	  r 	    sg    " > B/ F
7;
#
$
)
:
)(/
9
D)L JAr   r 	  c                     [        5       n SU R                  S5      -  nUS-  n[        XS9nUR                  5         [	        U SU 4S jS9nUR                  5         X0l        [	        U SU R                  S9nUR                  5         U R                  5         U R                  5         U R                  5         U R                  5         g )	NzThis is Tcl/Tk %stk_patchLevelu   
This should be a cedilla: çr  z	Click me!c                 T    U R                   R                  SU R                   S   -  S9$ )Nz[%s]r  rQ	  )testr  r   s    r   <lambda>_test.<locals>.<lambda>l  s)    		(;(;		& 11 )< )3r   )r  rG  QUIT)r   r'  r  r  r   rS	  r   r  r)   r  r|  )r   r  r  rS	  r~  s        r   _testrW	  e  s    4D!2!2?!CCD..D$"E	JJL$["& 34D 	IIKI$VT\\:DIIK 	LLNKKMNNMMOr   r  >   r  __main__)TNr+  r>  )NNr   F)gr   collectionsenumr  r:  r  r   tkinter.constantsr\   r  r  floatr0  	TkVersionr1  
TclVersionREADABLEWRITABLE	EXCEPTIONcompiler   ASCIIr   r   r
   r"   r*   r4   rB   
namedtuplerD   rb   _simple_enumStrEnumrd   r   r   r   r   r   r   r   r   r  r  r  r\  re  rm  rs  r|  r_   ri  rj  r  r  r,  r[  rq  r|  r   rK  r  rX  rZ  rk  rw  r  r  r  r   r  r  r  r  r  r  r  r#  rx  r}  r  r  r  r  rh  ru  r  r  r  r6  r;  r  r	  r 	  rW	  globalsr-   rc  r   
ModuleType__all__rR   )r   objs   00r   <module>rk	     s@  @   
    		(%%&	8''(
	 JJ{#	JJy"((+	,
8 !!X$ ##Y.S{--.@=? SG 4<< ' ' !'TO
 O
d  	"	
 q+ q+h 02X 22E E*A A<:
 
	=iA iAX+, ,,? ?*? ?*z zz	p&r p&f !$

 ,6+, +,\0. 0.f4, 4,n>4 >4B	Zud 	8z2 8<,/V ,/^o>VUE o>d	  .(& .(bSFE Sl?F ?(8F 80nfeU nbB*6 B*J= =:f :(& (B$7F $7N/2 /2di>65% i>X1 1$ $N;7 ;7|DF DFN@% @3
3
m$fe m$d= =0tA& tAr* ")!2 ,!2ID//#& /9#u?O?O/P ?* !2 , z	G oX  t ,  t zW,s<   0N ?N 2N'N',N'4N'NNN$#N$