ROOTPLOIT
Server: LiteSpeed
System: Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User: niphet (1079)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //lib64/python3.8/tkinter/__pycache__/__init__.cpython-38.opt-1.pyc
U

e5d͕@sdZddlZddlZddlZejZddlTddlZdZeej	Z
eejZej
Z
ejZejZedZedejZddZd	d
ZddZz
ejZWnek
rYnXd
dZz
ejZWnek
rYnXdyddZGdddeejZGdddZdadaddZ dzddZ!ddZ"d{ddZ#da$GdddZ%Gd d!d!e%Z&Gd"d#d#e%Z'Gd$d%d%e%Z(Gd&d'd'e%Z)d|d(d)Z*e+Z,eZ-d*d+Z.Gd,d-d-Z/Gd.d/d/Z0Gd0d1d1Z1Gd2d3d3Z2Gd4d5d5Z3Gd6d7d7e/e3Z4d}d8d9Z5Gd:d;d;Z6Gd<d=d=Z7Gd>d?d?Z8Gd@dAdAe/Z9GdBdCdCe9e6e7e8Z:GdDdEdEe9e3Z;GdFdGdGe:Z<GdHdIdIe:e1e2Z=GdJdKdKe:Z>GdLdMdMe:e1Z?GdNdOdOe:Z@GdPdQdQe:ZAGdRdSdSe:e1e2ZBGdTdUdUe:ZCGdVdWdWe:ZDGdXdYdYe:ZEGdZd[d[e:ZFGd\d]d]e:ZGGd^d_d_e:ZHGd`dadae:e1e2ZIGdbdcdcZJGdddedeeDZKGdfdgdgZLGdhdidieLZMGdjdkdkeLZNdldmZOdndoZPGdpdqdqe:e1ZQGdrdsdse:ZRGdtdudue:ZSdvdwZTeUdxkreTdS)~a8Wrapper 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 resource
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 resources (e.g. keyword argument
command) or with the method bind.

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)*z([\\{}])z([\s])cCsdtt|S)Internal function. )joinmap
_stringifyvaluer(/usr/lib64/python3.8/tkinter/__init__.py_join8sr
cCst|ttfrHt|dkr:t|d}t|rFd|}qdt|}ntt|}|sZd}nbt|rt	d|}|
dd}t	d|}|ddkrd	|}n|ddkst|rd|}|S)
rrrz{%s}z{}z\\\1
z\n"\)
isinstancelisttuplelenr	_magic_researchr
strsubreplace	_space_rer	rrrr=s$



rcCs@d}|D]2}t|ttfr(|t|}q|dk	r||f}q|S)rrN)rrr_flatten)seqresitemrrrrVsrcCst|tr|St|tdtfr$|Si}t|D]^}z||Wq0ttfk
r}z(td||	D]\}}|||<qjW5d}~XYq0Xq0|SdS)rNz_cnfmerge: fallback due to:)
rdicttyperrupdateAttributeError	TypeErrorprintitems)Zcnfscnfcmsgkvrrr	_cnfmergees

r+Tc	Csz||}t|drtdt|}i}t||D]@\}}t|}|r`|ddkr`|dd}|rl||}|||<q4|S)aReturn 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-rN)	splitlistrRuntimeErroriterzipr)	tkr*Z	cut_minusconvtitrkeyr
rrr
_splitdict{s

r7c@seZdZdZeZdZdZeZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#d Z$d!Z%d"Z&d#Z'd$Z(d%Z)e*j+Z+d&S)'	EventType23456789Z10Z11Z12Z13Z14Z15Z16Z17Z18Z19Z20Z21Z22Z23Z24Z25Z26Z27Z28Z29Z30Z31Z32Z33Z34Z35Z36Z37Z38N),__name__
__module____qualname__ZKeyPressZKeyZ
KeyReleaseZButtonPressButtonZ
ButtonReleaseZMotionZEnterZLeaveZFocusInZFocusOutZKeymapZExposeZGraphicsExposeZNoExposeZ
VisibilityZCreateZDestroyZUnmapZMapZ
MapRequestZReparentZ	ConfigureZConfigureRequestZGravityZ
ResizeRequestZ	CirculateZCirculateRequestZPropertyZSelectionClearZSelectionRequestZ	SelectionZColormapZ
ClientMessageMappingZVirtualEventZActivateZ
DeactivateZ
MouseWheelr__str__rrrrr8sPr8c@seZdZdZddZdS)EventaContainer 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)
    csdd|jD|js"d=n|jdkr:t|jd<t|ddsLd=|jdkr^d=n|t|jtr|j}d	}g}t|D]\}}|d
|>@r|	|q|d
t
|>d
@}|s|s|	t|d|d<|j
dkrd=d
}dt|jd|jdfdd|DfS)NcSsi|]\}}|dkr||qS)??r.0r)r*rrr
<dictcomp>sz"Event.__repr__.<locals>.<dictcomp>charrH
send_eventTrstate)
ZShiftZLockZControlZMod1ZMod2ZMod3ZMod4ZMod5ZButton1ZButton2ZButton3ZButton4ZButton5r|delta)rMrNkeysymkeycoderLnumrPfocusxywidthheightz<%s event%s>namec3s&|]}|krd||fVqdS)z %s=%sNr)rJr)attrsrr	<genexpr>
sz!Event.__repr__.<locals>.<genexpr>)__dict__r%rLreprgetattrrNrint	enumerateappendrhexrrPr )selfrNZmodssinkeysrr[r__repr__s6


zEvent.__repr__N)rArBrC__doc__rjrrrrrGs*rGcCsdadabdS)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_rootrrrr
NoDefaultRootsrncCs.tstdts*|r$td|dt}tS)NzINo master specified and tkinter is configured to not support default rootz
Too early to z: no default root window)rlr/rmTk)whatrootrrr_get_default_root#srrcCsdSrNr)errrrr_tkerror/srucCs.zt|}Wntk
r YnXt|dS)zBInternal function. Calling it will raise the exception SystemExit.N)ra
ValueError
SystemExit)coderrr_exit4s
ryc@seZdZdZdZdZdZdddZddZdd	Z	d
dZ
e
Zdd
ZddZ
ddZddZddZddZeZddZddZddZdS)VariablezClass 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().rZNcCs|dk	rt|tstd|s&td}||_|j|_|rD||_ndtt	|_t	d7a	|dk	rn|
|n&|j|jdd|js|
|j
dS)a.Construct 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.
        Nzname must be a stringzcreate variablePY_VARrinfoexists)rrr#rr_rootr2_tk_namer__varnum
initialize
getbooleancall_defaultremasterr
rYrrr__init__Is

zVariable.__init__cCsb|jdkrdS|j|jdd|jr6|j|j|jdk	r^|jD]}|j|qFd|_dS)zUnset the variable in Tcl.Nr|r})rrrrZglobalunsetvar_tclCommands
deletecommandrerYrrr__del__gs


zVariable.__del__cCs|jS)z'Return the name of the variable in Tcl.)rrerrrrFsszVariable.__str__cCs|j|j|SzSet the variable to VALUE.)rglobalsetvarrrer
rrrsetwszVariable.setcCs|j|jS)zReturn value of variable.)rglobalgetvarrrrrrget}szVariable.getcCst|d|jj}tt|}z
|j}Wntk
r:YnXz||j}Wntk
r^YnX|j	|||j
dkr~g|_
|j
||SN)CallWrapperr~__call__r_id__func__r"rAr
createcommandrrc)recallbackfcbnamerrr	_registers

zVariable._registercCs(||}|jddd|j||f|S)a#Define 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.
        traceaddvariablerrrrremoderrrrr	trace_adds

zVariable.trace_addcCsx|jddd|j|||D] \}}|j|d|kr qtq |j|z|j|Wntk
rrYnXdS)aDelete 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().
        rremoverrN)	rrr
trace_infor.rrrrvrerrmZcarrrtrace_removeszVariable.trace_removec
s4|jjfddt|jddd|jDS)z&Return all trace callback information.csg|]\}}||fqSrrrIr.rr
<listcomp>sz'Variable.trace_info.<locals>.<listcomp>rr|r)rr.rrrrrrrrszVariable.trace_infocCs$||}|jdd|j|||S)aDefine 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.
        rrrrrrrtrace_variables
zVariable.trace_variablecCs|jdd|j|||j|d}|D] \}}|j|d|kr.qq.|j|z|j|Wntk
rYnXdS)aSDelete 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.
        rZvdeleterN)	rrrr.rrrrrvrrrr
trace_vdeletes
zVariable.trace_vdeletecs(fddjjddjDS)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.
        csg|]}j|qSr)rr.rJrUrrrrsz(Variable.trace_vinfo.<locals>.<listcomp>rZvinfo)rr.rrrrrrtrace_vinfoszVariable.trace_vinfocCs6t|tstS|j|jko4|jj|jjko4|j|jkSr)rrzNotImplementedr	__class__rAr)reotherrrr__eq__s

zVariable.__eq__)NNN)rArBrCrkrrrrrrFrrrrrrrrrrrrrrrrrz@s&

rzc@s&eZdZdZdZdddZddZdS)		StringVarz#Value holder for strings variables.rZNcCst||||dS)a6Construct 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.
        Nrzrrrrrrs
zStringVar.__init__cCs$|j|j}t|tr|St|S)z#Return value of variable as string.)rrrrrrrrrrs
z
StringVar.get)NNNrArBrCrkrrrrrrrrs
rc@s&eZdZdZdZdddZddZdS)	IntVarz#Value holder for integer variables.rNcCst||||dS)a7Construct 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.
        Nrrrrrrs
zIntVar.__init__c	CsJ|j|j}z|j|WSttfk
rDt|j|YSXdS)z/Return the value of the variable as an integer.N)rrrgetintr#TclErrorra	getdoublerrrrrs
z
IntVar.get)NNNrrrrrr
s
rc@s&eZdZdZdZdddZddZdS)		DoubleVarz!Value holder for float variables.gNcCst||||dS)a6Construct 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.
        Nrrrrrr*s
zDoubleVar.__init__cCs|j|j|jS)z,Return the value of the variable as a float.)rrrrrrrrr6sz
DoubleVar.get)NNNrrrrrr&s
rc@s2eZdZdZdZd
ddZddZeZdd	ZdS)
BooleanVarz#Value holder for boolean variables.FNcCst||||dS)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.
        Nrrrrrr?s
zBooleanVar.__init__cCs|j|j|j|Sr)rrrrrrrrrKszBooleanVar.setcCs:z|j|j|jWStk
r4tdYnXdS)z+Return the value of the variable as a bool. invalid literal for getboolean()N)rrrrrrvrrrrrQszBooleanVar.get)NNN)	rArBrCrkrrrrrrrrrr;s
rcCstdj|dS)zRun the main loop of Tcl.zrun the main loopN)rrr2mainloop)rhrrrrYsrcCs4ztdj|WStk
r.tdYnXdS)z$Convert Tcl object to True or False.zuse getboolean()rN)rrr2rrrvrfrrrrcsrc@seZdZdZdZdZddZddZd1ddZd	d
Z	ddZ
d2ddZeZd3ddZ
d4ddZd5ddZd6ddZddZddZddZdd ZeZd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd7d/d0Zd1d2Zd3d4Zd8d6d7Z d8d9Z!d:d;Z"d<d=Z#d>d?Z$d@dAZ%dBdCZ&dDdEZ'dFdGZ(d9dHdIZ)dJdKZ*dLdMZ+d:dNdOZ,dPdQZ-dRdSZ.dTdUZ/dVdWZ0dXdYZ1dZd[Z2d;d\d]Z3d<d^d_Z4e4Z5d=d`daZ6d>dbdcZ7dddeZ8dfdgZ9dhdiZ:djdkZ;d?dldmZ<dndoZ=dpdqZ>drdsZ?dtduZ@dvdwZAdxdyZBd@dzd{ZCd|d}ZDd~dZEddZFddZGdAddZHddZIddZJddZKddZLddZMddZNddZOddZPddZQddZRddZSddZTddZUddZVddZWddZXddZYddZZddZ[ddZ\ddZ]ddZ^dBddZ_ddZ`ddZaddZbddZcddZdddZedd„ZfddĄZgddƄZhddȄZiddʄZjdCdd̄ZkdDddτZldEddфZmdFddӄZndGddՄZoddׄZpdHddلZqddۄZrdIdd݄Zsdd߄ZtddZuddZvddZwddZxeyddZzdJddZ{ddZ|e|Z}dKddZ~e~ZddZdZdeZddZddZddZddZddZdLddZeZddZeZddZddZddZdd	Zd
gZefddZeZd
dZeZddZdMddZeZdNddZeZddZddZifddZeZddZefddZifdd ZeZd!d"ZeZdOd#d$Zd%d&Zd'd(Zd)d*ZdPd+d,Zd-d.Zd/d0ZdS(QMisczRInternal class.

    Base class which defines methods common for interior widgets.NcCs,|jdk	r(|jD]}|j|qd|_dS)zkInternal function.

        Delete all Tcl commands created for
        this widget in the Tcl interpreter.N)rr2rrrrrdestroyxs

zMisc.destroycCs6|j|z|j|Wntk
r0YnXdS)zDInternal function.

        Delete the Tcl command provided in NAME.N)r2rrrrvrrrrrs
zMisc.deletecommandcCs|j|jdd|S)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.rtk_strictMotif)r2rrrebooleanrrrrs
zMisc.tk_strictMotifcCs|jddS)zDChange the color scheme to light brown as used in Tk 3.6 and before.	tk_bisqueNr2rrrrrrszMisc.tk_bisquecOs(|jdt|tt|dS)aSet 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)r2rrrr%reargskwrrrrs
zMisc.tk_setPaletter{cCs|jdd|dS)zWait until the variable is modified.

        A parameter of type IntVar, StringVar, DoubleVar or
        BooleanVar must be given.tkwaitrNrrrrr
wait_variableszMisc.wait_variablecCs"|dkr|}|jdd|jdS)zQWait until a WIDGET is destroyed.

        If no parameter is given self is used.Nrwindowr2r_wrerrrrwait_windowszMisc.wait_windowcCs"|dkr|}|jdd|jdS)zxWait until the visibility of a WIDGET changes
        (e.g. it appears).

        If no parameter is given self is used.NrZ
visibilityrrrrrwait_visibilityszMisc.wait_visibility1cCs|j||dS)zSet Tcl variable NAME to VALUE.N)r2setvar)rerYr
rrrrszMisc.setvarcCs|j|S)z"Return value of Tcl variable NAME.)r2getvarrrrrrszMisc.getvarc
CsBz|j|WStk
r<}ztt|W5d}~XYnXdSr)r2rrrvrrerfexcrrrrszMisc.getintc
CsBz|j|WStk
r<}ztt|W5d}~XYnXdSr)r2rrrvrrrrrrszMisc.getdoublecCs0z|j|WStk
r*tdYnXdS)zPReturn a boolean value for Tcl boolean values true and false given as parameter.rN)r2rrrv)rerfrrrrszMisc.getbooleancCs|jd|jdS)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.rTNrrrrr	focus_setszMisc.focus_setcCs|jdd|jdS)ztDirect input focus to this widget even if the
        application does not have the focus. Use with
        caution!rTz-forceNrrrrrfocus_forceszMisc.focus_forcecCs&|jd}|dks|sdS||S)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.rTnoneN)r2r
_nametowidgetrrrr	focus_getszMisc.focus_getcCs,|jdd|j}|dks|s"dS||S)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.rT
-displayofrNr2rrrrrrrfocus_displayofszMisc.focus_displayofcCs,|jdd|j}|dks|s"dS||S)zyReturn the widget which would have the focus if top level
        for this widget gets the focus from the window manager.rTz-lastforrNrrrrr
focus_lastforszMisc.focus_lastforcCs|jddS)zXThe widget under mouse will get automatically focus. Can not
        be disabled easily.tk_focusFollowsMouseNrrrrrrszMisc.tk_focusFollowsMousecCs"|jd|j}|sdS||S)anReturn 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 resource set
        to 0.tk_focusNextNrrrrrr
s	zMisc.tk_focusNextcCs"|jd|j}|sdS||S)zHReturn previous widget in the focus order. See tk_focusNext for details.tk_focusPrevNrrrrrrszMisc.tk_focusPrevcsNsjd|dSfdd}j|_|jd|SdS)aCall 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.afterNcs8zW5zWntk
r0YnXXdSr)rrrrfuncrYrerrcallit,szMisc.after.<locals>.callit)r2rrAr)reZmsrrrrrrr s
z
Misc.aftercGs|jd|f|S)zCall FUNC once if the Tcl main loop has no event to
        process.

        Return an identifier to cancel the scheduling with
        after_cancel.Zidle)r)rerrrrr
after_idle8szMisc.after_idlecCsd|stdz.|jdd|}|j|d}||Wntk
rNYnX|jdd|dS)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_idlerr|rZcancelN)rvr2rr.rr)rerdataZscriptrrrafter_cancel@szMisc.after_cancelrcCs|jd||dS)zRing a display's bell.)bellN)r2r
_displayofre	displayofrrrrQsz	Misc.bellcKsdd|krN|jdkrNz d|d<|jd||WStk
rL|d=YnX|jd||S)aRetrieve 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 x11UTF8_STRING)	clipboardr)_windowingsystemr2r_optionsrrerrrr
clipboard_getVszMisc.clipboard_getcKs,d|kr|j|d<|jd||dS)zClear the data in the Tk clipboard.

        A widget specified for the optional displayof keyword
        argument specifies the target display.r)rclearNrr2rrrrrrclipboard_clearms
zMisc.clipboard_clearcKs4d|kr|j|d<|jd||d|fdS)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)rrc--Nr)restringrrrrclipboard_appendus

zMisc.clipboard_appendcCs$|jdd|j}|sdS||S)zOReturn widget which has currently the grab in this application
        or None.grabZcurrentNrrrrrgrab_currentszMisc.grab_currentcCs|jdd|jdS)z.Release grab for this widget if currently set.rreleaseNrrrrrgrab_releaseszMisc.grab_releasecCs|jdd|jdS)zwSet grab for this widget.

        A grab directs all events to this and descendant
        widgets in the application.rrNrrrrrgrab_setsz
Misc.grab_setcCs|jddd|jdS)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.rrz-globalNrrrrrgrab_set_globalszMisc.grab_set_globalcCs"|jdd|j}|dkrd}|S)zYReturn None, "local" or "global" if this widget has
        no, a local or a global grab.rstatusrNr)rerrrrgrab_statusszMisc.grab_statuscCs|jdd|||dS)zSet a VALUE (second parameter) for an option
        PATTERN (first parameter).

        An optional third parameter gives the numeric priority
        (defaults to 80).optionrNr)repatternr
priorityrrr
option_addszMisc.option_addcCs|jdddS)zPClear the option database.

        It will be reloaded if option_add is called.rrNrrrrroption_clearszMisc.option_clearcCs|jdd|j||S)zReturn the value for an option NAME for this widget
        with CLASSNAME.

        Values with higher priority override lower values.rrr)rerY	classNamerrr
option_getszMisc.option_getcCs|jdd||dS)zvRead file FILENAME into the option database.

        An optional second parameter gives the numeric
        priority.rZreadfileNr)reZfileNamerrrroption_readfileszMisc.option_readfilecKs,d|kr|j|d<|jd||dS)zClear the current X selection.r)	selectionrNrrrrrselection_clears
zMisc.selection_clearcKsvd|kr|j|d<d|kr`|jdkr`z d|d<|jd||WStk
r^|d=YnX|jd||S)aReturn 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.rr rr)rr)rrr2rrrrrrr
selection_gets	
zMisc.selection_getcKs.||}|jd|||j|fdS)aSpecify 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ZhandleN)rr2rrr)recommandrrYrrrselection_handles
zMisc.selection_handlecKs"|jd|||jfdS)zBecome owner of X selection.

        A keyword parameter selection specifies the name of
        the selection (default PRIMARY).rZownN)r2rrrrrrr
selection_owns
zMisc.selection_owncKs:d|kr|j|d<|jd||}|s0dS||S)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).rrN)rr2rrr)rerrYrrrselection_own_gets
zMisc.selection_own_getcGs|jd||f|S)zDSend Tcl command CMD to different interpreter INTERP to be executed.sendr)reZinterpcmdrrrrrsz	Misc.sendcCs|jd|j|dS)z(Lower this widget in the stacking order.lowerNr)re	belowThisrrrrsz
Misc.lowercCs|jd|j|dS)z(Raise this widget in the stacking order.raiseNr)re	aboveThisrrrtkraiseszMisc.tkraisecCs(d|||f}|j|j|S)z*Return integer which represents atom NAME.)winfoZatom)rr2rr)rerYrrrrr
winfo_atomszMisc.winfo_atomcCs d|||f}|j|S)z'Return name of atom with identifier ID.)rZatomnamerr2rrerrrrrrwinfo_atomnameszMisc.winfo_atomnamecCs|j|jdd|jS)z7Return number of cells in the colormap for this widget.rZcellsr2rrrrrrrwinfo_cellsszMisc.winfo_cellsc	CsRg}|j|jdd|jD].}z|||Wqtk
rJYqXq|S)z?Return a list of all widgets which are children of this widget.rchildren)r2r.rrrcrKeyError)reresultchildrrrwinfo_childrenszMisc.winfo_childrencCs|jdd|jS)z(Return window class name of this widget.rclassrrrrrwinfo_class#szMisc.winfo_classcCs|j|jdd|jS)z?Return True if at the last color request the colormap was full.rZcolormapfullr2rrrrrrrwinfo_colormapfull'szMisc.winfo_colormapfullcCs4d||||f}|j|}|s*dS||S)z@Return the widget which is at the root coordinates ROOTX, ROOTY.)rZ
containingN)rr2rr)reZrootXZrootYrrrYrrrwinfo_containing,szMisc.winfo_containingcCs|j|jdd|jS)z$Return the number of bits per pixel.rZdepthr rrrrwinfo_depth4szMisc.winfo_depthcCs|j|jdd|jS)z"Return true if this widget exists.rr}r rrrrwinfo_exists8szMisc.winfo_existscCs|j|jdd|j|S)zWReturn the number of pixels for the given distance NUMBER
        (e.g. "3c") as float.rZfpixelsr2rrrrenumberrrr
winfo_fpixels=szMisc.winfo_fpixelscCs|jdd|jS)zFReturn geometry string for this widget in the form "widthxheight+X+Y".rgeometryrrrrrwinfo_geometryCszMisc.winfo_geometrycCs|j|jdd|jS)zReturn height of this widget.rrXr rrrrwinfo_heightGszMisc.winfo_heightcCst|jdd|jdS)z%Return identifier ID for this widget.rrr)rar2rrrrrrwinfo_idLsz
Misc.winfo_idcCs"d||}|j|j|S)z9Return the name of all Tcl interpreters for this display.)rZinterps)rr2r.r)rerrrrr
winfo_interpsPszMisc.winfo_interpscCs|j|jdd|jS)z%Return true if this widget is mapped.rZismappedr rrrrwinfo_ismappedUszMisc.winfo_ismappedcCs|jdd|jS)z/Return the window manager name for this widget.rZmanagerrrrrr
winfo_managerZszMisc.winfo_managercCs|jdd|jS)zReturn the name of this widget.rrYrrrrr
winfo_name^szMisc.winfo_namecCs|jdd|jS)z-Return the name of the parent of this widget.rparentrrrrrwinfo_parentbszMisc.winfo_parentcCs d|||f}|j|S)z.Return the pathname of the widget given by ID.)rpathnamerrrrrwinfo_pathnamefszMisc.winfo_pathnamecCs|j|jdd|j|S)z'Rounded integer value of winfo_fpixels.rZpixelsr r/rrrwinfo_pixelslszMisc.winfo_pixelscCs|j|jdd|jS)z:Return the x coordinate of the pointer on the root window.rZpointerxr rrrrwinfo_pointerxqszMisc.winfo_pointerxcCs||jdd|jS)zHReturn a tuple of x and y coordinates of the pointer on the root window.rZ	pointerxy_getintsr2rrrrrrwinfo_pointerxyvszMisc.winfo_pointerxycCs|j|jdd|jS)z:Return the y coordinate of the pointer on the root window.rZpointeryr rrrrwinfo_pointery{szMisc.winfo_pointerycCs|j|jdd|jS)z'Return requested height of this widget.rZ	reqheightr rrrrwinfo_reqheightszMisc.winfo_reqheightcCs|j|jdd|jS)z&Return requested width of this widget.rZreqwidthr rrrrwinfo_reqwidthszMisc.winfo_reqwidthcCs||jdd|j|S)zNReturn a tuple of integer RGB values in range(65536) for color in this widget.rZrgbr@)reZcolorrrr	winfo_rgbszMisc.winfo_rgbcCs|j|jdd|jS)zSReturn x coordinate of upper left corner of this widget on the
        root window.rZrootxr rrrrwinfo_rootxszMisc.winfo_rootxcCs|j|jdd|jS)zSReturn y coordinate of upper left corner of this widget on the
        root window.rZrootyr rrrrwinfo_rootyszMisc.winfo_rootycCs|jdd|jS)z&Return the screen name of this widget.rscreenrrrrrwinfo_screenszMisc.winfo_screencCs|j|jdd|jS)zTReturn the number of the cells in the colormap of the screen
        of this widget.rZscreencellsr rrrrwinfo_screencellsszMisc.winfo_screencellscCs|j|jdd|jS)z\Return the number of bits per pixel of the root window of the
        screen of this widget.rZscreendepthr rrrrwinfo_screendepthszMisc.winfo_screendepthcCs|j|jdd|jS)zXReturn the number of pixels of the height of the screen of this widget
        in pixel.rZscreenheightr rrrrwinfo_screenheightszMisc.winfo_screenheightcCs|j|jdd|jS)zUReturn the number of pixels of the height of the screen of
        this widget in mm.rZscreenmmheightr rrrrwinfo_screenmmheightszMisc.winfo_screenmmheightcCs|j|jdd|jS)zTReturn the number of pixels of the width of the screen of
        this widget in mm.rZ
screenmmwidthr rrrrwinfo_screenmmwidthszMisc.winfo_screenmmwidthcCs|jdd|jS)zReturn one of the strings directcolor, grayscale, pseudocolor,
        staticcolor, staticgray, or truecolor for the default
        colormodel of this screen.rZscreenvisualrrrrrwinfo_screenvisualszMisc.winfo_screenvisualcCs|j|jdd|jS)zWReturn the number of pixels of the width of the screen of
        this widget in pixel.rZscreenwidthr rrrrwinfo_screenwidthszMisc.winfo_screenwidthcCs|jdd|jS)zxReturn information of the X-Server of the screen of this widget in
        the form "XmajorRminor vendor vendorVersion".rZserverrrrrrwinfo_serverszMisc.winfo_servercCs||jdd|jS)z*Return the toplevel widget of this widget.rtoplevel)rr2rrrrrrwinfo_toplevels

zMisc.winfo_toplevelcCs|j|jdd|jS)zBReturn true if the widget and all its higher ancestors are mapped.rZviewabler rrrrwinfo_viewableszMisc.winfo_viewablecCs|jdd|jS)zReturn one of the strings directcolor, grayscale, pseudocolor,
        staticcolor, staticgray, or truecolor for the
        colormodel of this widget.rvisualrrrrrwinfo_visualszMisc.winfo_visualcCs|jdd|jS)z7Return the X identifier for the visual for this widget.rZvisualidrrrrrwinfo_visualidszMisc.winfo_visualidFcsHjddj|rdnd}fddj|D}fdd|DS)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.rZvisualsavailable
includeidsNcsg|]}j|qSr)r2r.rrrrrsz/Misc.winfo_visualsavailable.<locals>.<listcomp>csg|]}|qSr)_Misc__winfo_parseitemrrrrrs)r2rrr.)rerYrrrrwinfo_visualsavailables

zMisc.winfo_visualsavailablecCs$|ddtt|j|ddS)rNr)rr_Misc__winfo_getint)rer4rrrZ__winfo_parseitemszMisc.__winfo_parseitemcCs
t|dS)rr)rarerUrrrZ__winfo_getintszMisc.__winfo_getintcCs|j|jdd|jS)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.rZvrootheightr rrrrwinfo_vrootheightszMisc.winfo_vrootheightcCs|j|jdd|jS)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.rZ
vrootwidthr rrrrwinfo_vrootwidthszMisc.winfo_vrootwidthcCs|j|jdd|jS)ziReturn the x offset of the virtual root relative to the root
        window of the screen of this widget.rZvrootxr rrrrwinfo_vrootxszMisc.winfo_vrootxcCs|j|jdd|jS)ziReturn the y offset of the virtual root relative to the root
        window of the screen of this widget.rZvrootyr rrrrwinfo_vrooty	szMisc.winfo_vrootycCs|j|jdd|jS)z Return the width of this widget.rrWr rrrrwinfo_widthszMisc.winfo_widthcCs|j|jdd|jS)zVReturn the x coordinate of the upper left corner of this widget
        in the parent.rrUr rrrrwinfo_xszMisc.winfo_xcCs|j|jdd|jS)zVReturn the y coordinate of the upper left corner of this widget
        in the parent.rrVr rrrrwinfo_yszMisc.winfo_ycCs|jddS)zEEnter event loop until all pending events have been processed by Tcl.r!Nrrrrrr! szMisc.updatecCs|jdddS)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!Z	idletasksNrrrrrupdate_idletasks$szMisc.update_idletaskscCs6|dkr |j|jd|jS|jd|j|dS)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).Nbindtagsr2r.rr)reZtagListrrrrf*s
z
Misc.bindtagsrcCst|tr |j|||fnn|rd|||j|}d|r>dp@d||jf}|j|||f|S|rz|j||fS|j|j|SdS)rz"%sif {"[%s %s]" == "break"} break
+rZN)rrr2rr_substitute_subst_format_strr.)rerpsequencerrneedcleanupfuncidrrrr_bind7s"


z
Misc._bindcCs|d|jf|||S)aOBind 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.bindrnrrerkrrrrrroIs'z	Misc.bindcCs&|jd|j|d|r"||dS)zWUnbind for this widget for event SEQUENCE  the
        function identified with FUNCID.rorZNr2rrr)rerkrmrrrunbindrszMisc.unbindcCs|d|||dS)aBind 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.)roallrrnrqrrrbind_allysz
Misc.bind_allcCs|jdd|ddS)z8Unbind for all widgets for event SEQUENCE all functions.rortrZNr)rerkrrr
unbind_allszMisc.unbind_allcCs|d|f|||dS)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.rorru)rer	rkrrrrr
bind_classszMisc.bind_classcCs|jd||ddS)zWUnbind for all widgets with bindtag CLASSNAME for event SEQUENCE
        all functions.rorZNr)rer	rkrrrunbind_classszMisc.unbind_classcCs|j|dS)zCall the mainloop of Tk.N)r2r)rerhrrrrsz
Misc.mainloopcCs|jdS)z8Quit the Tcl interpreter. All widgets will be destroyed.N)r2quitrrrrrzsz	Misc.quitcCs"|rtt|jj|j|SdSrs)rrr2rr.rerrrrrAsz
Misc._getintscCs"|rtt|jj|j|SdSrs)rrr2rr.r{rrr_getdoublesszMisc._getdoublescCs|r|j|SdSrs)r2rr{rrr_getbooleanszMisc._getbooleancCs"|rd|fS|dkrd|jfSdS)rrNrrrrrrrs

zMisc._displayofcCsBz|jWStk
r<|jdd}|_|YSXdS)rr2ZwindowingsystemN)r~Z_windowingsystem_cachedr"r2r)reZwsrrrrszMisc._windowingsystemcCs|rt||f}nt|}d}|D]\}}|dk	r&|ddkrN|dd}t|rb||}n^t|ttfrg}|D]<}t|tr|t	|qxt|t	r|t
|qxqqxd|}|d||f}q&|S)rrN_rr-)r+r%callablerrrrrarcrrr)rer&rrr)r*Znvrrrrrs*


z
Misc._optionscCsNt|d}|}|ds.|}|dd}|D]}|s>qJ|j|}q2|S)zPReturn the Tkinter instance of a widget identified by
        its Tcl name NAME..rrN)rsplitr~r")rerYwrhrrrnametowidgetszMisc.nametowidgetcCst|||j}tt|}z
|j}Wntk
r8YnXz||j}Wntk
r\YnX|j|||r|j	dkrg|_	|j	
||S)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.N)rrr_rrr"rAr2rrrc)rersubstrlrrYrrrrs 

zMisc._registercCs|}|jr|j}q|S)rr)rerrrrr~sz
Misc._root)z%#z%bz%fz%hz%kz%sz%tz%wz%xz%yz%Az%Ez%Kz%Nz%Wz%Tz%Xz%Yz%Drcst|t|jkr|S|jj}|jjfdd}|\}}}}}}	}
}}}
}}}}}}}}}t}||_|||_z|||_Wnt	k
rYnX|||_
|||_||	|_||
|_
|||_|||_||
|_||_z|||_Wnt	k
r
YnX||_|||_zt||_Wntk
rF||_YnXz|||_Wntk
rt||_YnX|||_|||_z||_Wn tt	fk
rd|_YnX|fS)rc	s,z
|WSttfk
r&|YSXdS)z?Tk changed behavior in 8.4.2, returning "??" rather more often.N)rvrrrrrgetint_events
z&Misc._substitute.<locals>.getint_eventr)r
_subst_formatr2rrrGserialrSrTrrXrRrNtimerWrUrVrLrMrQZ
keysym_numr8r rvrwidgetr#Zx_rootZy_rootrP)rerrrZnsignbrhr)rfr4rrUrVAEKNWTXYDerrrrisT*











zMisc._substitutecCs(t\}}}|}||||dSrs)sysexc_infor~report_callback_exception)rervaltbrqrrr_report_exceptionHszMisc._report_exceptioncGs\i}|j|jj|D]>}|j|}|dddf|dd||ddd<q|S)z;Call Tcl configure command and return the result as a dict.rrNr2r.r)rerr&rUrrr
_getconfigureNs
0zMisc._getconfigurecGs2|j|jj|}|dddf|ddS)Nrrr)rerrUrrr_getconfigure1VszMisc._getconfigure1cCs|rt||f}n|rt|}|dkr:|t|j|fSt|tr^|t|j|d|fS|jt|j|f|	|dS)rNr-)
r+rrrrrrr2rr)rerr&rrrr
_configureZs
zMisc._configurecKs|d||S)zConfigure resources of a widget.

        The values for resources are specified as keyword
        arguments. To get an overview about
        the allowed keyword arguments call the method keys.
        	configurerrer&rrrrrgszMisc.configurecCs|j|jdd|S)z4Return the resource value for a KEY given as string.cgetr-rrer6rrrrrsz	Misc.cgetcCs|||idSr)rrer6r
rrr__setitem__xszMisc.__setitem__cs*|jjfdd|j|jdDS)z3Return a list of all resource names of this widget.cs g|]}|dddqS)rrNrrrrrr~szMisc.keys.<locals>.<listcomp>rrgrrrrri{s
z	Misc.keyscCs|jS)z+Return the window path name of this widget.r~rrrrrFszMisc.__str__cCsd|jj|jj|jfS)Nz<%s.%s object %s>)rrBrCrrrrrrjs
z
Misc.__repr___noarg_cCs:|tjkr"||jdd|jS|jdd|j|dS)aSet 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	propagateNrrr}r2rrreflagrrrpack_propagates

zMisc.pack_propagatecs(fddjjddjDS)HReturn a list of all slaves of this widget
        in its packing order.csg|]}|qSrrrrrrrsz$Misc.pack_slaves.<locals>.<listcomp>rslavesrgrrrrpack_slavess

zMisc.pack_slavescs(fddjjddjDS)rcsg|]}|qSrrrrrrrsz%Misc.place_slaves.<locals>.<listcomp>placerrgrrrrplace_slavess
zMisc.place_slavescCs|jdd|j|dS)zThe anchor value controls how to place the grid within the
        master when no row/column has any weight.

        The default anchor is nw.gridanchorNr)rerrrrgrid_anchorszMisc.grid_anchorcCsZdd|jf}|dk	r(|dk	r(|||f}|dk	rD|dk	rD|||f}||jj|pXdS)aReturn 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.
        rbboxN)rrAr2r)recolumnrowZcol2Zrow2rrrr	grid_bboxszMisc.grid_bboxc	Csht|ttjfrdz:t|}|s$WdSd|kr:|j|WS|j|WSWnttfk
rbYnX|S)Nr)	rr_tkinterZTcl_Objr2rrrvr)rer
Zsvaluerrr_gridconvvalueszMisc._gridconvvaluecCst|trJ|sJ|dddkr*|dd}|dddkrBd|}|f}n|||}|s|t|j|jd||j||jdS|jd||j|f|}t|dkr||SdS)rrNrrr-r)r3)	rrrr7r2rrrr)rerindexr&roptionsrrrr_grid_configures(zMisc._grid_configurecKs|d|||S)zConfigure column INDEX of a grid.

        Valid resources 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).columnconfigurerrerr&rrrrgrid_columnconfigureszMisc.grid_columnconfigurec	Cs ||jdd|j||pdS)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.rlocationNr@rerUrVrrr
grid_locationszMisc.grid_locationcCs:|tjkr"||jdd|jS|jdd|j|dS)aSet 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.
        rrNrrrrrgrid_propagates

zMisc.grid_propagatecKs|d|||S)zConfigure row INDEX of a grid.

        Valid resources 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).rowconfigurerrrrrgrid_rowconfigureszMisc.grid_rowconfigurecCs||jdd|jpdS)z<Return a tuple of the number of column and rows in the grid.rsizeNr@rrrr	grid_sizes
zMisc.grid_sizecsZd}|dk	r|d|f}|dk	r,|d|f}fddjjddjf|DS)	rrNz-rowz-columncsg|]}|qSrrrrrrr(sz$Misc.grid_slaves.<locals>.<listcomp>rrrg)rerrrrrrgrid_slaves s
zMisc.grid_slavescGsdd|f|}|j|dS)zBind a virtual event VIRTUAL (of the form <<Name>>)
        to an event SEQUENCE such that the virtual event is triggered
        whenever SEQUENCE occurs.eventrNrrevirtual	sequencesrrrr	event_add/szMisc.event_addcGsdd|f|}|j|dS)z-Unbind a virtual event VIRTUAL from SEQUENCE.rdeleteNrrrrrevent_delete6szMisc.event_deletecKsDdd|j|f}|D]\}}|d|t|f}q|j|dS)zGenerate an event SEQUENCE. Additional
        keyword arguments specify parameter of the event
        (e.g. x, y, rootx, rooty).rZgenerate-%sN)rr%rr2r)rerkrrr)r*rrrevent_generate;szMisc.event_generatecCs|j|jdd|S)zuReturn a list of all virtual events or the information
        about the SEQUENCE bound to the virtual event VIRTUAL.rr|r)rerrrr
event_infoDszMisc.event_infocCs|j|jddS)z*Return a list of all existing image names.imagenamesrrrrrimage_namesLszMisc.image_namescCs|j|jddS)z?Return a list of all available image types (e.g. photo bitmap).rtypesrrrrrimage_typesPszMisc.image_types)N)r{)N)N)r{r)r{)N)r)N)N)N)N)r)r)r)r)r)F)N)r)NNN)N)NNN)NNN)r)N)Nr)N)N)NNNN)NN)N)rArBrCrk_last_child_idsrrrrrrrZwaitvarrrrrrrrrrTrrrrrrrrrrrrrrrrrrrrrr
rr
rrrrrrrliftrrr!r&r(r*r+r,r-r1r3r4r5r6r7r8r9r;r=r>r?rBrCrDrErFrGrHrJrKrLrMrNrOrPrQrRrTrUrWrXr[rZr\r^r_r`rarbrcrdr!rerfrnrorsrvrwrxryrrzrAr|r}rpropertyrrrrrregisterr~rrrjrirrrrrconfigr__getitem__rrirFrjrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmsP
		


)

	
=
	


	rc@s eZdZdZddZddZdS)rzwInternal class. Stores function to call when some user
    defined Tcl function is called e.g. after an event occurred.cCs||_||_||_dS)z(Store FUNC, SUBST and WIDGET as members.N)rrr)rerrrrrrrYszCallWrapper.__init__cGsLz|jr|j|}|j|WStk
r2Yn|jYnXdS)z3Apply first function SUBST to arguments, than FUNC.N)rrrwrrrerrrrr_s
zCallWrapper.__call__NrArBrCrkrrrrrrrUsrc@s(eZdZdZddZddZddZdS)	XViewzXMix-in class for querying and changing the horizontal position
    of a widget's window.cGs(|jj|jdf|}|s$||SdS)z5Query and change the horizontal position of the view.xviewNr2rrr|rerrrrrroszXView.xviewcCs|j|jdd|dS)zsAdjusts the view in the window so that FRACTION of the
        total width of the canvas is off-screen to the left.rmovetoNrrefractionrrrxview_movetouszXView.xview_movetocCs|j|jdd||dS)z\Shift the x-view according to NUMBER which is measured in "units"
        or "pages" (WHAT).rscrollNrrer0rprrrxview_scrollzszXView.xview_scrollN)rArBrCrkrrrrrrrrksrc@s(eZdZdZddZddZddZdS)	YViewzVMix-in class for querying and changing the vertical position
    of a widget's window.cGs(|jj|jdf|}|s$||SdS)z3Query and change the vertical position of the view.yviewNrrrrrrszYView.yviewcCs|j|jdd|dS)zsAdjusts the view in the window so that FRACTION of the
        total height of the canvas is off-screen to the top.rrNrrrrryview_movetoszYView.yview_movetocCs|j|jdd||dS)z\Shift the y-view according to NUMBER which is measured in
        "units" or "pages" (WHAT).rrNrrrrryview_scrollszYView.yview_scrollN)rArBrCrkrrrrrrrrsrc@seZdZdZdBddZeZddZeZdCddZeZ	d	d
Z
e
ZdDddZeZ
d
dZeZdEddZeZddZeZddZeZdFddZeZdGddZeZdHddZeZdIddZeZddZeZdJdd Z e Z!dKd!d"Z"e"Z#dLd$d%Z$e$Z%dMd&d'Z&e&Z'dNd(d)Z(e(Z)d*d+Z*e*Z+dOd,d-Z,e,Z-dPd.d/Z.e.Z/dQd0d1Z0e0Z1dRd2d3Z2e2Z3dSd4d5Z4e4Z5dTd6d7Z6e6Z7dUd8d9Z8e8Z9dVd:d;Z:e:Z;dWd<d=Z<e<Z=dXd>d?Z>e>Z?d@dAZ@e@ZAdS)YWmzAProvides functions for the communication with the window manager.NcCs ||jdd|j||||S)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.wmaspectr@)reZminNumerZminDenomZmaxNumerZmaxDenomrrr	wm_aspectszWm.wm_aspectcGsdd|jf|}|j|S)aThis subcommand returns or sets platform specific attributes

        The first form returns a list of the platform specific flags and
        their values. The second form returns the value for the specific
        option. The third form sets one or more of the values. The values
        are as follows:

        On Windows, -disabled gets or sets whether the window is in a
        disabled state. -toolwindow gets or sets the style of the window
        to toolwindow (as defined in the MSDN). -topmost gets or sets
        whether this is a topmost window (displays above all other
        windows).

        On Macintosh, XXXXX

        On Unix, there are currently no special attribute values.
        r
attributes)rr2rrrrr
wm_attributesszWm.wm_attributescCs|jdd|j|S)zVStore NAME in WM_CLIENT_MACHINE property of this widget. Return
        current value.rclientrrrrr	wm_clientszWm.wm_clientcsZt|dkr|f}ddjf|}|r4j|n"fddjj|DSdS)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.rrcolormapwindowscsg|]}|qSrrrrrrrsz)Wm.wm_colormapwindows.<locals>.<listcomp>N)rrr2rr.)reZwlistrrrrwm_colormapwindowss
zWm.wm_colormapwindowscCs|jdd|j|S)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.rrrrrrr
wm_commandsz
Wm.wm_commandcCs|jdd|jS)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	deiconifyrrrrrwm_deiconifyszWm.wm_deiconifycCs|jdd|j|S)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)reZmodelrrr
wm_focusmodelszWm.wm_focusmodelcCs|jdd|dS)aAThe 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.rforgetNrrrrr	wm_forgetszWm.wm_forgetcCs|jdd|jS)zAReturn identifier for decorative frame of this widget if present.rframerrrrrwm_frameszWm.wm_framecCs|jdd|j|S)ziSet geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return
        current value if None is given.rr2r)reZnewGeometryrrrwm_geometryszWm.wm_geometrycCs ||jdd|j||||S)aInstruct 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.rrr@)reZ	baseWidthZ
baseHeightZwidthIncZ	heightIncrrrwm_grids
z
Wm.wm_gridcCs|jdd|j|S)z~Set the group leader widgets for related widgets to PATHNAME. Return
        the group leader of this widget if None is given.rgrouprreZpathNamerrrwm_group
szWm.wm_groupcCs2|r|jdd|jd|S|jdd|j|SdS)aSet 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 descendents 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-defaultNr)rebitmapdefaultrrr
wm_iconbitmaps	zWm.wm_iconbitmapcCs|jdd|jS)zDisplay widget as icon.riconifyrrrrr
wm_iconify$sz
Wm.wm_iconifycCs|jdd|j|S)zVSet mask for the icon bitmap of this widget. Return the
        mask if None is given.riconmaskr)rerrrrwm_iconmask*szWm.wm_iconmaskcCs|jdd|j|S)zSSet the name of the icon for this widget. Return the name if
        None is given.riconnamer)reZnewNamerrrwm_iconname1szWm.wm_iconnameFcGs<|r |jjdd|jdf|n|jjdd|jf|dS)aSets 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	iconphotorNr)rerrrrrwm_iconphoto8szWm.wm_iconphotoc	Cs||jdd|j||S)zSet 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@rrrrwm_iconpositionSs
zWm.wm_iconpositioncCs|jdd|j|S)zgSet widget PATHNAME to be displayed instead of icon. Return the current
        value if None is given.r
iconwindowrr
rrr
wm_iconwindow[szWm.wm_iconwindowcCs|jdd|dS)zThe widget specified will become a stand alone top-level window.
        The window will be decorated with the window managers title bar,
        etc.rmanageNr)rerrrr	wm_managebszWm.wm_managec	Cs||jdd|j||S)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.rmaxsizer@rerWrXrrr
wm_maxsizejs
z
Wm.wm_maxsizec	Cs||jdd|j||S)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.rminsizer@r#rrr
wm_minsizess
z
Wm.wm_minsizecCs||jdd|j|S)zInstruct the window manager to ignore this widget
        if BOOLEAN is given with 1. Return the current value if None
        is given.roverrideredirect)r}r2rrrrrrwm_overrideredirect|s
zWm.wm_overrideredirectcCs|jdd|j|S)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positionfromrreZwhorrrwm_positionfromszWm.wm_positionfromcCs.t|r||}n|}|jdd|j||S)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".rprotocol)rrr2rr)rerYrrrrrwm_protocolszWm.wm_protocolcCs|jdd|j||S)zyInstruct the window manager whether this width can be resized
        in WIDTH or HEIGHT. Both values are boolean values.r	resizablerr#rrrwm_resizableszWm.wm_resizablecCs|jdd|j|S)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".rsizefromrr*rrrwm_sizefromszWm.wm_sizefromcCs|jdd|j|S)zQuery or set the state of this widget as one of normal, icon,
        iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).rrNr)reZnewstaterrrwm_stateszWm.wm_statecCs|jdd|j|S)zSet the title of this widget.rtitlerr{rrrwm_titleszWm.wm_titlecCs|jdd|j|S)z_Instruct the window manager that this widget is transient
        with regard to widget MASTER.r	transientr)rerrrrwm_transientszWm.wm_transientcCs|jdd|jS)zWithdraw this widget from the screen such that it is unmapped
        and forgotten by the window manager. Re-draw it with wm_deiconify.rwithdrawrrrrrwm_withdrawszWm.wm_withdraw)NNNN)N)N)N)N)NNNN)N)NN)N)N)F)NN)N)NN)NN)N)N)NN)NN)N)N)N)N)BrArBrCrkrrrrrrrrrrrrrrrrr	rr
r2rrrrrrrrrrrrrrrrrrr!r r$r"r&r%r(r'r+r)r-r,r/r.r1r0r2rNr4r3r6r5r8r7rrrrrs























rc@sNeZdZdZdZdddZdd	Zd
dZdd
ZddZ	ddZ
ddZdS)rozzToplevel widget of Tk which represents mostly the main window
    of an application. It has an associated Tcl interpreter.rNrrc

Csd|_i|_d|_d|_|dkrZddl}|jtjd}|j	|\}}|dkrZ||}d}	t
||||	t||||_|r|
tjjs|||dS)a@Return a new Toplevel 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)rr"	_tkloadedr2ospathbasenamerargvsplitextrcreatewantobjects_loadtkflagsignore_environmentreadprofile)
re
screenNamebaseNamer	useTksyncZuser:Zextinteractiverrrrs zTk.__init__cCs|js|j|dSr)r9r2loadtkrArrrrrJs
z	Tk.loadtkcCsd|_|jd}|tjkr.tdtj|ft|jd}|tjkrZtdtj|f|jdkrjg|_|j	dt
|j	dt|jd|jdt
rts|a|d|jdS)	NT
tk_versionz4tk.h version (%s) doesn't match libtk.a version (%s)tcl_versionz6tcl.h version (%s) doesn't match libtcl.a version (%s)ZtkerrorexitWM_DELETE_WINDOW)r9r2rr
TK_VERSIONr/rTCL_VERSIONrrruryrcrlrmr,r)rerKrLrrrrAs(


z
Tk._loadtkcCsJt|jD]}|q|jd|jt|trFt	|krFda	dS)zhDestroy this and all descendants widgets. This will
        end the application of this Tcl interpreter.rN)
rr"valuesrr2rrrrlrmrer'rrrr	s

z
Tk.destroyc
Csddl}d|jkr|jd}n|j}|j|d|}|j|d|}|j|d|}|j|d|}d|i}	td|	|j|r|jd||j|rtt	|
|	|j|r|jd||j|rtt	|
|	dS)	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.rNHOMEz.%s.tclz.%s.pyrezfrom tkinter import *source)r:environcurdirr;rexecisfiler2ropenread)
rerFr	r:homeZ	class_tclZclass_pyZbase_tclZbase_pydirrrrrD	s$

zTk.readprofilecCs:ddl}tdtjd|t_|t_|t_||||dS)zReport callback exception on sys.stderr.

        Applications may want to override this internal function, and
        should when sys.stderr is None.rNzException in Tkinter callback)file)	tracebackr$rstderr	last_type
last_valuelast_tracebackprint_exception)rerrrr^rrrr$	szTk.report_callback_exceptioncCst|j|S)z3Delegate attribute access to the interpreter object)r`r2)reattrrrr__getattr__0	szTk.__getattr__)NNrorrN)rArBrCrkrrrJrArrDrrerrrrros

rocCst||||Sr)ro)rErFr	rGrrrTclC	srfc@sTeZdZdZifddZeZZZddZeZ	ddZ
e
Zej
ZZ
ejZZdS)	PackzQGeometry manager Pack.

    Base class to use the methods pack_* in every widget.cKs$|jdd|jf|||dS)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.
        rrNr2rrrrrrrpack_configureL	s


zPack.pack_configurecCs|jdd|jdS)z:Unmap this widget and do not use it for the packing order.rrNrrrrrpack_forgetb	szPack.pack_forgetcCs8t|j|jdd|j}d|kr4||d|d<|S)zEReturn information about the packing options
        for this widget.rr|inr7r2rrrredrrr	pack_infoh	szPack.pack_infoN)rArBrCrkrirrrrjrror|rrrrrrrrrrgG	s
rgc@sJeZdZdZifddZeZZZddZeZ	ddZ
e
Zej
ZZ
dS)	PlacezSGeometry manager Place.

    Base class to use the methods place_* in every widget.cKs$|jdd|jf|||dS)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
        rrNrhrrrrplace_configurez	s


zPlace.place_configurecCs|jdd|jdS)Unmap this widget.rrNrrrrrplace_forget	szPlace.place_forgetcCs8t|j|jdd|j}d|kr4||d|d<|S)zEReturn information about the placing options
        for this widget.rr|rkrlrmrrr
place_info	szPlace.place_infoN)rArBrCrkrqrrrrsrrtr|rrrrrrrrpu	srpc@seZdZdZifddZeZZZej	Z
Z	ejZZddZ
e
ZddZdd	ZeZejZZejZZejZZejZZejZZd
S)GridzQGeometry manager Grid.

    Base class to use the methods grid_* in every widget.cKs$|jdd|jf|||dS)aPosition 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
        rrNrhrrrrgrid_configure	s


zGrid.grid_configurecCs|jdd|jdS)rrrrNrrrrrgrid_forget	szGrid.grid_forgetcCs|jdd|jdS)z0Unmap this widget but remember the grid options.rrNrrrrrgrid_remove	szGrid.grid_removecCs8t|j|jdd|j}d|kr4||d|d<|S)zSReturn information about the options
        for positioning this widget in a grid.rr|rkrlrmrrr	grid_info	szGrid.grid_infoN)rArBrCrkrvrrrrrrrrrwrrxryr|rrrrrrrrrrrrrrru	s





ruc@s:eZdZdZddZiidfddZddZdd	d
ZdS)
BaseWidgetzInternal class.cCs|s
t}||_|j|_d}d|kr2|d}|d=|s|jj}|jdkrRi|_|j|dd}||j|<|dkrd|f}nd||f}||_|j	dkrd||_	n|j	d||_	i|_
|j|jj
kr|jj
|j||jj
|j<dS)z6Internal function. Sets up information about children.NrYrrz!%sz!%s%dr)rrrr2rrArrrrrr"r)rerr&rYcountrrr_setup	s2


zBaseWidget._setuprc	Cs|rt||f}||_t||||jdkr4g|_dd|D}|D]\}}||=qJ|j||jf||	||D]\}}|
||q~dS)zdConstruct a widget with the parent widget MASTER, a name WIDGETNAME
        and appropriate options.NcSs"g|]\}}t|tr||fqSr)rr rIrrrr	
s
z'BaseWidget.__init__.<locals>.<listcomp>)r+
widgetNamerzr|rr%r2rrrr)	rerr}r&rextraclassesr)r*rrrr
s
zBaseWidget.__init__cCsTt|jD]}|q|jd|j|j|jjkrF|jj|j=t	|dS)z)Destroy this and all descendants widgets.rN)
rr"rQrr2rrrrrrRrrrr
s
zBaseWidget.destroycCs|j|j|f|Srr)rerYrrrr_do
szBaseWidget._doN)r)rArBrCrkr|rrrrrrrrz	s
rzc@seZdZdZdS)WidgetzxInternal class.

    Base class for a widget which can be positioned with the geometry managers
    Pack, Place or Grid.N)rArBrCrkrrrrr
src@seZdZdZdifddZdS)Toplevelz"Toplevel widget, e.g. for dialogs.Nc	Ks|rt||f}d}dD]L}||kr||}|ddkrJd|dd}nd|}|||f}||=qt||d|i||}|||||d|jdS)	a%Construct a toplevel widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, class,
        colormap, container, cursor, height, highlightbackground,
        highlightcolor, highlightthickness, menu, relief, screen, takefocus,
        use, visual, width.r)rIclass_r'rVZcolormaprrr-NrSrN)r+rzrr~rr3r,r)	rerr&rr~Zwmkeyroptrqrrrr)
s zToplevel.__init__rArBrCrkrrrrrr&
src@s.eZdZdZdifddZddZddZdS)	rDzButton widget.NcKst||d||dS)aUConstruct 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
        ZbuttonNrrrerr&rrrrrG
szButton.__init__cCs|j|jddS)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.
        flashNrrrrrr\
s
zButton.flashcCs|j|jdS)aInvoke 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.
        invokerrrrrrh
sz
Button.invoke)rArBrCrkrrrrrrrrDD
srDc@seZdZdZdifddZddZddZd	d
ZddZdwd
dZ	ddZ
ddZddZddZ
dxddZdyddZdzddZd{ddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!d?d@Z"dAdBZ#d|dCdDZ$dEdFZ%dGdHZ&dIdJZ'dKdLZ(dMdNZ)dOdPZ*dQdRZ+dSdTZ,dUdVZ-d}dWdXZ.e.Z/dYdZZ0e0Z1d[d\Z2d~d^d_Z3ifd`daZ4dbdcZ5e5Z6Z7dddeZ8dfdgZ9ddidjZ:dkdlZ;dmdnZ<dodpZ=dqdrZ>dsdtZ?dudvZ@dS)Canvasz?Canvas widget to display graphical elements like lines or text.NcKst||d||dS)aConstruct a canvas widget with the parent MASTER.

        Valid resource 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.ZcanvasNrrrrrrv
s
zCanvas.__init__cGs|j|jdf|dS)raddtagNrrrrrr
sz
Canvas.addtagcCs||d|dS)z*Add tag NEWTAG to all items above TAGORID.aboveNrrenewtagtagOrIdrrraddtag_above
szCanvas.addtag_abovecCs||ddS)zAdd tag NEWTAG to all items.rtNr)rerrrr
addtag_all
szCanvas.addtag_allcCs||d|dS)z*Add tag NEWTAG to all items below TAGORID.belowNrrrrraddtag_below
szCanvas.addtag_belowcCs||d||||dS)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
        closests). If START is specified the next below this tag is taken.closestNr)rerrUrVhalostartrrraddtag_closest
szCanvas.addtag_closestcCs||d||||dS)zLAdd tag NEWTAG to all items in the rectangle defined
        by X1,Y1,X2,Y2.enclosedNrrerx1y1x2y2rrraddtag_enclosed
szCanvas.addtag_enclosedcCs||d||||dS)zWAdd tag NEWTAG to all items which overlap the rectangle
        defined by X1,Y1,X2,Y2.overlappingNrrrrraddtag_overlapping
szCanvas.addtag_overlappingcCs||d|dS)z)Add tag NEWTAG to all items with TAGORID.withtagNrrrrraddtag_withtag
szCanvas.addtag_withtagcGs ||j|jdf|pdS)z|Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
        which encloses all items with tags specified as arguments.rNr@rrrrr
s
zCanvas.bboxcCs(|j|jd||d|r$||dS)zbUnbind for all items with TAGORID for event SEQUENCE  the
        function identified with FUNCID.rorZNrr)rerrkrmrrr
tag_unbind
szCanvas.tag_unbindcCs||jd|f|||S)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.rorp)rerrkrrrrrtag_bind
s
zCanvas.tag_bindcCs|j|j|jd||S)zrReturn the canvas x coordinate of pixel position SCREENX rounded
        to nearest multiple of GRIDSPACING units.canvasxr.)reZscreenxgridspacingrrrr
szCanvas.canvasxcCs|j|j|jd||S)zrReturn the canvas y coordinate of pixel position SCREENY rounded
        to nearest multiple of GRIDSPACING units.canvasyr.)reZscreenyrrrrr
szCanvas.canvasycs,fddjjjdf|DS)z8Return a list of coordinates for the item given in ARGS.csg|]}j|qSr)r2rrrrrr
sz!Canvas.coords.<locals>.<listcomp>coordsrgrrrrr
s

z
Canvas.coordsc	Cs\t|}|d}t|ttfr,|dd}ni}|j|jj|jd|f||||S)rrNr?)	rrrrr2rrrr)reitemTyperrr&rrr_create
szCanvas._createcOs|d||S)z6Create arc shaped region with coordinates x1,y1,x2,y2.Zarcrrrrr
create_arc
szCanvas.create_arccOs|d||S)z%Create bitmap with coordinates x1,y1.rrrrrr
create_bitmap
szCanvas.create_bitmapcOs|d||S)z)Create image item with coordinates x1,y1.rrrrrrcreate_image
szCanvas.create_imagecOs|d||S)z-Create line with coordinates x1,y1,...,xn,yn.linerrrrrcreate_line
szCanvas.create_linecOs|d||S)z)Create oval with coordinates x1,y1,x2,y2.Zovalrrrrrcreate_oval
szCanvas.create_ovalcOs|d||S)z0Create polygon with coordinates x1,y1,...,xn,yn.Zpolygonrrrrrcreate_polygon
szCanvas.create_polygoncOs|d||S)z.Create rectangle with coordinates x1,y1,x2,y2.Z	rectanglerrrrrcreate_rectangle
szCanvas.create_rectanglecOs|d||S)z#Create text with coordinates x1,y1.textrrrrrcreate_text
szCanvas.create_textcOs|d||S)z+Create window with coordinates x1,y1,x2,y2.rrrrrr
create_window
szCanvas.create_windowcGs|j|jdf|dS)zDelete characters of text items identified by tag or id in ARGS (possibly
        several times) from FIRST to LAST character (including).dcharsNrrrrrrsz
Canvas.dcharscGs|j|jdf|dS)z<Delete items identified by all tag or ids contained in ARGS.rNrrrrrrsz
Canvas.deletecGs|j|jdf|dS)ziDelete tag or id given as last arguments in ARGS from items
        identified by first argument in ARGS.dtagNrrrrrr	szCanvas.dtagcGs ||j|jdf|pdS)rfindrr@rrrrrs
zCanvas.findcCs|d|S)zReturn items above TAGORID.rrrerrrr
find_aboveszCanvas.find_abovecCs
|dS)zReturn all items.rtrrrrrfind_allszCanvas.find_allcCs|d|S)zReturn all items below TAGORID.rrrrrr
find_belowszCanvas.find_belowcCs|d||||S)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.rr)rerUrVrrrrrfind_closestszCanvas.find_closestcCs|d||||S)z=Return all items in rectangle defined
        by X1,Y1,X2,Y2.rrrerrrrrrr
find_enclosed&szCanvas.find_enclosedcCs|d||||S)zLReturn all items which overlap the rectangle
        defined by X1,Y1,X2,Y2.rrrrrrfind_overlapping+szCanvas.find_overlappingcCs|d|S)zReturn all items with TAGORID.rrrrrrfind_withtag0szCanvas.find_withtagcGs|j|jdf|S)z.Set focus to the first item specified in ARGS.rTrrrrrrT4szCanvas.focuscGs|j|j|jdf|S)z=Return tags associated with the first item specified in ARGS.gettagsrgrrrrr8szCanvas.gettagscGs|j|jdf|dS)zdSet cursor at position POS in the item identified by TAGORID.
        In ARGS TAGORID must be first.icursorNrrrrrr=szCanvas.icursorcGs|j|j|jdf|S)z?Return position of cursor as integer in item specified in ARGS.rr rrrrrBszCanvas.indexcGs|j|jdf|dS)zSInsert TEXT in item TAGORID at position POS. ARGS must
        be TAGORID POS TEXT.insertNrrrrrrFsz
Canvas.insertcCs|j|jdf|d|fS)z9Return the resource value for an OPTION for item TAGORID.itemcgetr-r)rerrrrrrKszCanvas.itemcgetcKs|d|f||S)zConfigure resources of an item TAGORID.

        The values for resources are specified as keyword
        arguments. To get an overview about
        the allowed keyword arguments call the method without arguments.
        
itemconfigurerrerr&rrrrrPszCanvas.itemconfigurecGs|j|jdf|dS)zJLower an item TAGORID given in ARGS
        (optional below another item).rNrrrrr	tag_lower_szCanvas.tag_lowercGs|j|jdf|dS)z#Move an item TAGORID given in ARGS.moveNrrrrrrfszCanvas.moverZcCs|j|jd|||dS)a}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.rNr)rerrUrVrrrrjsz
Canvas.movetocKs|j|jdf|||S)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.
postscriptrhrrrrrss
zCanvas.postscriptcGs|j|jdf|dS)zJRaise an item TAGORID given in ARGS
        (optional above another item).rNrrrrr	tag_raise{szCanvas.tag_raisecGs|j|jdf|dS)z9Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE.scaleNrrrrrrszCanvas.scalecCs|j|jdd||dSz&Remember the current X, Y coordinates.scanmarkNrrrrr	scan_markszCanvas.scan_mark
cCs|j|jdd|||dS)zAdjust the view of the canvas to GAIN times the
        difference between X and Y and the coordinates given in
        scan_mark.rdragtoNr)rerUrVZgainrrrscan_dragtoszCanvas.scan_dragtocCs|j|jdd||dS)zLAdjust the end of the selection near the cursor of an item TAGORID to index.selectadjustNrrerrrrr
select_adjustszCanvas.select_adjustcCs|j|jdddS),Clear the selection if it is in this widget.rrNrrrrrselect_clearszCanvas.select_clearcCs|j|jdd||dS)z:Set the fixed end of a selection in item TAGORID to INDEX.rfromNrrrrrselect_fromszCanvas.select_fromcCs|j|jddpdS)z(Return the item which has the selection.rrNrrrrrselect_itemszCanvas.select_itemcCs|j|jdd||dS)z=Set the variable end of a selection in item TAGORID to INDEX.rtoNrrrrr	select_toszCanvas.select_tocCs|j|jd|pdS)z$Return the type of the item TAGORID.r Nrrrrrr szCanvas.type)NN)N)NNN)N)N)NN)N)rZrZ)r)ArArBrCrkrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrTrrrrrr
itemconfigrrrrrrrrrrrrrrrrr rrrrrs
sz


	



	
	
rc@sFeZdZdZdifddZddZddZd	d
ZddZd
dZ	dS)Checkbuttonz7Checkbutton widget which is either in on- or off-state.NcKst||d||dS)aConstruct a checkbutton widget with the parent MASTER.

        Valid resource 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.checkbuttonNrrrrrrs
zCheckbutton.__init__cCs|j|jddSzPut the button in off-state.deselectNrrrrrrszCheckbutton.deselectcCs|j|jddSzFlash the button.rNrrrrrrszCheckbutton.flashcCs|j|jdSz<Toggle the button and invoke a command if given as resource.rrrrrrrszCheckbutton.invokecCs|j|jddSzPut the button in on-state.rNrrrrrrszCheckbutton.selectcCs|j|jddS)zToggle the button.toggleNrrrrrrszCheckbutton.toggle)
rArBrCrkrrrrrrrrrrrsrc@seZdZdZdifddZdddZddZd	d
ZddZd
dZ	ddZ
ddZddZeZ
ddZeZddZeZddZeZddZeZddZeZdS) Entryz1Entry widget which allows displaying simple text.NcKst||d||dS)aConstruct an entry widget with the parent MASTER.

        Valid resource 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.entryNrrrrrrszEntry.__init__cCs|j|jd||dS)z.Delete text from FIRST to LAST (not included).rNrrefirstZlastrrrrszEntry.deletecCs|j|jdS)zReturn the text.rrrrrrrsz	Entry.getcCs|j|jd|dS)zInsert cursor at INDEX.rNrrerrrrrsz
Entry.icursorcCs|j|j|jd|S)zReturn position of cursor.rr rrrrrs
zEntry.indexcCs|j|jd||dS)zInsert STRING at INDEX.rNr)rerrrrrrszEntry.insertcCs|j|jdd|dSrrr]rrrrszEntry.scan_markcCs|j|jdd|dS)zAdjust the view of the canvas to 10 times the
        difference between X and Y and the coordinates given in
        scan_mark.rrNrr]rrrrszEntry.scan_dragtocCs|j|jdd|dS)z9Adjust the end of the selection near the cursor to INDEX.rrNrrrrrselection_adjustszEntry.selection_adjustcCs|j|jdddS)rrrNrrrrrr
szEntry.selection_clearcCs|j|jdd|dS)*Set the fixed end of a selection to INDEX.rrNrrrrrselection_fromszEntry.selection_fromcCs|j|j|jddS)zSReturn True if there are characters selected in the entry, False
        otherwise.rpresentr)rrrrselection_presentszEntry.selection_presentcCs|j|jdd||dS)3Set the selection from START to END (not included).rrangeNrrerendrrrselection_rangeszEntry.selection_rangecCs|j|jdd|dS)-Set the variable end of a selection to INDEX.rrNrrrrrselection_toszEntry.selection_to)N)rArBrCrkrrrrrrrrrrr
rrrrZselect_presentrZselect_rangerrrrrrrs*
rc@seZdZdZdifddZdS)FramezFFrame widget which may contain other widgets and can have a 3D border.NcKs^t||f}d}d|kr,d|df}|d=nd|krFd|df}|d=t||d|i|dS)aConstruct a frame widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, class,
        colormap, container, cursor, height, highlightbackground,
        highlightcolor, highlightthickness, relief, takefocus, visual, width.rrz-classr'rN)r+rr)rerr&rr~rrrr&szFrame.__init__rrrrrr#src@seZdZdZdifddZdS)Labelz0Label widget which can display text and bitmaps.NcKst||d||dS)aConstruct 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

        labelNrrrrrr:szLabel.__init__rrrrrr7src@seZdZdZdifddZddZddZd	d
Zd)ddZd*d
dZ	ddZ
ddZddZddZ
ddZddZddZeZd+ddZeZdd ZeZd,d!d"ZeZd#d$Zd%d&Zd-d'd(ZeZdS).Listboxz3Listbox widget which can display a list of strings.NcKst||d||dS)aConstruct a listbox widget with the parent MASTER.

        Valid resource 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.ZlistboxNrrrrrrRszListbox.__init__cCs|j|jd|dS)z"Activate item identified by INDEX.activateNrrrrrr\szListbox.activatecCs||j|jd|pdS)zxReturn a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
        which encloses the item identified by the given index.rNr@rrrrr`szListbox.bboxcCs||j|jdpdS)z.Return the indices of currently selected item.curselectionrr@rrrrreszListbox.curselectioncCs|j|jd||dS)z+Delete items from FIRST to LAST (included).rNrrrrrriszListbox.deletecCs:|dk	r$|j|j|jd||S|j|jd|SdS)z0Get list of items from FIRST to LAST (included).NrrgrrrrrmszListbox.getcCs*|j|jd|}|dkrdS|j|S)z+Return index of item identified with INDEX.rrNr2rrrrerrgrrrrusz
Listbox.indexcGs|j|jd|f|dS)zInsert ELEMENTS at INDEX.rNr)rerelementsrrrr{szListbox.insertcCs|j|j|jd|S)z5Get index of item which is nearest to y coordinate Y.nearestr )rerVrrrrs
zListbox.nearestcCs|j|jdd||dSrrrrrrrszListbox.scan_markcCs|j|jdd||dS)zAdjust the view of the listbox to 10 times the
        difference between X and Y and the coordinates given in
        scan_mark.rrNrrrrrrszListbox.scan_dragtocCs|j|jd|dS)z"Scroll such that INDEX is visible.seeNrrrrrrszListbox.seecCs|j|jdd|dS)z-Set the fixed end oft the selection to INDEX.rrNrrrrrselection_anchorszListbox.selection_anchorcCs|j|jdd||dS)z2Clear the selection from FIRST to LAST (included).rrNrrrrrr
s
zListbox.selection_clearcCs|j|j|jdd|S)z.Return True if INDEX is part of the selection.rZincludesr)rrrrselection_includesszListbox.selection_includescCs|j|jdd||dS)ziSet the selection from FIRST to LAST (included) without
        changing the currently selected elements.rrNrrrrr
selection_setszListbox.selection_setcCs|j|j|jdS)z-Return the number of elements in the listbox.rr rrrrrszListbox.sizecCs|j|jdf|d|fS)z4Return the resource value for an ITEM and an OPTION.rr-rrerrrrrrszListbox.itemcgetcKs|d|f||S)a9Configure resources of an ITEM.

        The values for resources are specified as keyword arguments.
        To get an overview about the allowed keyword arguments
        call the method without arguments.
        Valid resource names: background, bg, foreground, fg,
        selectbackground, selectforeground.rrrrrrrszListbox.itemconfigure)N)N)N)N)N)rArBrCrkrrrrrrrrrrrrrZ
select_anchorr
rrZselect_includesr	Z
select_setrrrrrrrrrOs2






rc@seZdZdZdifddZd6ddZdd	Zifd
dZifdd
ZifddZ	ifddZ
ifddZifddZifddZ
ifddZifddZifddZifddZifd d!Zd7d"d#Zd$d%Zd8d&d'ZeZd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5ZdS)9MenuzPMenu widget which allows displaying menu bars, pull-down menus and pop-up menus.NcKst||d||dS)aAConstruct menu widget with the parent MASTER.

        Valid resource names: activebackground, activeborderwidth,
        activeforeground, background, bd, bg, borderwidth, cursor,
        disabledforeground, fg, font, foreground, postcommand, relief,
        selectcolor, takefocus, tearoff, tearoffcommand, title, type.menuNrrrrrrsz
Menu.__init__rZcCs|jd|j|||dS)z/Post the menu at position X,Y with entry ENTRY.tk_popupNr)rerUrVrrrrr
sz
Menu.tk_popupcCs|j|jd|dS)zActivate entry at INDEX.rNrrrrrrsz
Menu.activatecKs$|j|jd|f|||dS)rrNrh)rerr&rrrrrs
zMenu.addcKs|d|p|dS)zAdd hierarchical menu item.cascadeNrrrrradd_cascadeszMenu.add_cascadecKs|d|p|dS)zAdd checkbutton menu item.rNrrrrradd_checkbuttonszMenu.add_checkbuttoncKs|d|p|dS)zAdd command menu item.rNrrrrradd_commandszMenu.add_commandcKs|d|p|dS)zAddd radio menu item.radiobuttonNrrrrradd_radiobuttonszMenu.add_radiobuttoncKs|d|p|dS)zAdd separator.	separatorNrrrrr
add_separatorszMenu.add_separatorcKs&|j|jd||f|||dS)rrNrh)rerrr&rrrrrs
zMenu.insertcKs||d|p|dS)z$Add hierarchical menu item at INDEX.rNrrrrrinsert_cascadeszMenu.insert_cascadecKs||d|p|dS)z#Add checkbutton menu item at INDEX.rNrrrrrinsert_checkbuttonszMenu.insert_checkbuttoncKs||d|p|dS)zAdd command menu item at INDEX.rNrrrrrinsert_commandszMenu.insert_commandcKs||d|p|dS)zAddd radio menu item at INDEX.rNrrrrrinsert_radiobutton
szMenu.insert_radiobuttoncKs||d|p|dS)zAdd separator at INDEX.rNrrrrrinsert_separator
szMenu.insert_separatorcCs|dkr|}||||}}|dks2|dkr:d\}}t||dD]0}d||krHt||d}|rH||qH|j|jd||dS)z7Delete menu items between INDEX1 and INDEX2 (included).N)rrrrr)	rrentryconfigr	entrycgetrr2rr)reindex1index2Z
num_index1Z
num_index2rgr'rrrr	
szMenu.deletecCs|j|jd|d|S)z=Return the resource value of a menu item for OPTION at INDEX.rr-rr
rrrr
szMenu.entrycgetcKs|d|f||S)zConfigure a menu item at INDEX.entryconfigurerrrrrr!
szMenu.entryconfigurecCs*|j|jd|}|dkrdS|j|S)z4Return the index of a menu item identified by INDEX.rrNrrrrrr#
sz
Menu.indexcCs|j|jd|S)zRInvoke a menu item identified by INDEX and execute
        the associated command.rrrrrrr)
szMenu.invokecCs|j|jd||dS)zDisplay a menu at position X,Y.postNrrrrrr".
sz	Menu.postcCs|j|jd|S)z*Return the type of the menu item at INDEX.r rrrrrr 2
sz	Menu.typecCs|j|jddS)z
Unmap a menu.unpostNrrrrrr#6
szMenu.unpostcCs|j|j|jd|S)zNReturn the x-position of the leftmost pixel of the menu item
        at INDEX.	xpositionr rrrrr$:
szMenu.xpositioncCs|j|j|jd|S)zEReturn the y-position of the topmost pixel of the menu item at INDEX.	ypositionr rrrrr%?
s
zMenu.yposition)rZ)N)N)rArBrCrkrr
rrrrrrrrrrrrrrrr!rrrr"r r#r$r%rrrrrs6	


rc@seZdZdZdifddZdS)
Menubuttonz(Menubutton widget, obsolete since Tk8.0.NcKst||d||dS)N
menubuttonrrrrrrH
szMenubutton.__init__rrrrrr&E
sr&c@seZdZdZdifddZdS)MessagezKMessage widget to display multiline text. Obsolete since Label does it too.NcKst||d||dS)NmessagerrrrrrO
szMessage.__init__rrrrrr(L
sr(c@s>eZdZdZdifddZddZddZd	d
ZddZdS)
RadiobuttonzGRadiobutton widget which shows only one of several buttons in on-state.NcKst||d||dS)aConstruct a radiobutton widget with the parent MASTER.

        Valid resource 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.rNrrrrrrV
s
zRadiobutton.__init__cCs|j|jddSrrrrrrrb
szRadiobutton.deselectcCs|j|jddSrrrrrrrg
szRadiobutton.flashcCs|j|jdSrrrrrrrk
szRadiobutton.invokecCs|j|jddSrrrrrrro
szRadiobutton.select)	rArBrCrkrrrrrrrrrr*S
sr*c@s@eZdZdZdifddZddZddZd
d	d
ZddZdS)Scalez1Scale widget which can display a numerical scale.NcKst||d||dS)aConstruct a scale widget with the parent MASTER.

        Valid resource 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.rNrrrrrrw
s	zScale.__init__c
CsJ|j|jd}z|j|WStttfk
rD|j|YSXdS)z*Get the current value as integer or float.rN)r2rrrrvr#rrrrrrr
s
z	Scale.getcCs|j|jd|dS)zSet the value to VALUE.rNrrrrrr
sz	Scale.setcCs||j|jd|S)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.rr@rrrrr
szScale.coordscCs|j|jd||S)zcReturn where the point X,Y lies. Valid return values are "slider",
        "though1" and "though2".identifyrrrrrr,
szScale.identify)N)	rArBrCrkrrrrr,rrrrr+t
s
r+c@sPeZdZdZdifddZdddZddZd	d
ZddZd
dZ	ddZ
dS)	Scrollbarz?Scrollbar widget which displays a slider at a certain position.NcKst||d||dS)alConstruct a scrollbar widget with the parent MASTER.

        Valid resource names: activebackground, activerelief,
        background, bd, bg, borderwidth, command, cursor,
        elementborderwidth, highlightbackground,
        highlightcolor, highlightthickness, jump, orient,
        relief, repeatdelay, repeatinterval, takefocus,
        troughcolor, width.Z	scrollbarNrrrrrr
s	zScrollbar.__init__cCs|j|jd|pdS)aMarks 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.rNrrrrrr
szScrollbar.activatecCs|j|j|jd||S)znReturn the fractional change of the scrollbar setting if it
        would be moved by DELTAX or DELTAY pixels.rPr.)reZdeltaxZdeltayrrrrP
szScrollbar.deltacCs|j|j|jd||S)zRReturn the fractional value which corresponds to a slider
        position of X,Y.rr.rrrrr
szScrollbar.fractioncCs|j|jd||S)zYReturn the element under position X,Y as one of
        "arrow1","slider","arrow2" or "".r,rrrrrr,
szScrollbar.identifycCs||j|jdS)zZReturn the current fractional values (upper and lower end)
        of the slider position.r)r|r2rrrrrrr
sz
Scrollbar.getcCs|j|jd||dS)ziSet the fractional values of the slider position (upper and
        lower ends as value between 0 and 1).rNrrrrrr
sz
Scrollbar.set)N)rArBrCrkrrrPrr,rrrrrrr-
s
	r-c@seZdZdZdifddZddZddZd	d
ZdkddZdld
dZ	ddZ
dmddZddZdnddZ
ddZddZddZddZdodd Zd!d"Zdpd#d$Zifd%d&Zd'd(Zd)d*Zd+d,Zdqd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zifd9d:Zd;d<Z d=d>Z!d?d@Z"dAdBZ#drdCdDZ$dEdFZ%dGdHZ&dsdIdJZ'dtdKdLZ(dMdNZ)dudOdPZ*e*Z+dQdRZ,dvdSdTZ-dwdUdVZ.dxdWdXZ/dydYdZZ0dzd[d\Z1d]d^Z2d{d_d`Z3dadbZ4d|dcddZ5e5Z6ifdedfZ7dgdhZ8didjZ9dS)}Textz4Text widget which can display text in various forms.NcKst||d||dS)aConstruct 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,

        rNrrrrrr
sz
Text.__init__cCs||j|jd|pdS)zReturn a tuple of (x,y,width,height) which gives the bounding
        box of the visible part of the character at the given index.rNr@rrrrr
s
z	Text.bboxc	Cs|j|j|jd|||S)zReturn whether between index INDEX1 and index INDEX2 the
        relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.comparer))reropr rrrr/
szText.comparecGsVdd|D}|||g7}|jj|jdf|p2d}|dk	rNt|dkrN|fS|SdS)aCounts 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 by
        args. The result is a list of integers, one for the result of each
        counting option given. Valid counting options are "chars",
        "displaychars", "displayindices", "displaylines", "indices",
        "lines", "xpixels" and "ypixels". There is an additional possible
        option "update", which if given then all subsequent options ensure
        that any possible out of date information is recalculated.cSsg|]}|dsd|qS)r-r)
startswith)rJargrrrrs
zText.count.<locals>.<listcomp>r{N)r2rrr)rerr rrrrrr{
sz
Text.countcCs6|dkr |j|j|jdS|j|jd|dS)zjTurn on the internal consistency checks of the B-Tree inside the text
        widget according to BOOLEAN.Ndebugr)rrrrr4	sz
Text.debugcCs|j|jd||dS)z?Delete the characters between INDEX1 and INDEX2 (not included).rNrrerr rrrrszText.deletecCs||j|jd|S)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@rrrrr6szText.dlineinfoc
	Ksg}d}d}|s$g}|fdd}|}zzt|ts>||}}|d|g7}|D]}	||	rN|d|	qN|||r|||jj|jdf||WS|r||XdS)aReturn 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.NcSs||||fdSr)rc)r6r
rr$rrr
append_triple/sz Text.dump.<locals>.append_triplez-commandr-dump)rrrrrcr2rr)
rerr rrrZ	func_namer$r7r6rrrr8s*


z	Text.dumpcGs|jj|jdf|S)arInternal 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

        editrrrrrr9Bs
z	Text.editcCs|d|S)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.
        Zmodifiedr9)rer2rrr
edit_modifiedQs	zText.edit_modifiedcCs
|dS)aRedo 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.
        Zredor:rrrr	edit_redo\szText.edit_redocCs
|dS)z(Clears the undo and redo stacks
        resetr:rrrr
edit_resetfszText.edit_resetcCs
|dS)znInserts a separator (boundary) on the undo stack.

        Does nothing when the undo option is false
        rr:rrrredit_separatorkszText.edit_separatorcCs
|dS)aDUndoes 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
        Zundor:rrrr	edit_undors	zText.edit_undocCs|j|jd||S)z5Return the text from INDEX1 to INDEX2 (not included).rrr5rrrr}szText.getcCsJ|dddkrd|}|dddkr4|dd}|j|jdd||S)z9Return the value of OPTION of an embedded image at INDEX.Nrr-rrrrrr
rrr
image_cgets
zText.image_cgetcKs|dd|f||S)z%Configure an embedded image at INDEX.rrrrrrrimage_configureszText.image_configurecKs"|jj|jdd|f|||S)z"Create an embedded image at INDEX.rr?rhrrrrimage_creates
zText.image_createcCs|j|jddS)z3Return all names of embedded images in this widget.rrrrrrrrszText.image_namescCst|j|jd|S)z1Return the index in the form line.char for INDEX.r)rr2rrrrrrrsz
Text.indexcGs|j|jd||f|dS)zInsert CHARS before the characters at INDEX. An additional
        tag can be given in ARGS. Additional CHARS and tags can follow in ARGS.rNr)rercharsrrrrrszText.insertcCs|j|jdd||fS)zChange the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT).
        Return the current value if None is given for DIRECTION.rZgravityr)remarkName	directionrrrmark_gravityszText.mark_gravitycCs|j|j|jddS)zReturn all mark names.rrrgrrrr
mark_namess
zText.mark_namescCs|j|jdd||dS)z0Set mark MARKNAME before the character at INDEX.rrNr)rerErrrrmark_setsz
Text.mark_setcGs|j|jddf|dS)zDelete all marks in MARKNAMES.rZunsetNr)reZ	markNamesrrr
mark_unsetszText.mark_unsetcCs|j|jdd|pdS)z-Return the name of the next mark after INDEX.rnextNrrrrr	mark_nextszText.mark_nextcCs|j|jdd|pdS)z2Return the name of the previous mark before INDEX.rZpreviousNrrrrr
mark_previousszText.mark_previouscKs&|jj|jdd|f|||dS)aCreates 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?Nrh)reZnewPathNamer&rrrrpeer_creates
zText.peer_createcCs|j|j|jddS)zYReturns a list of peers of this widget (this does not include
        the widget itself).rNrrgrrrr
peer_namesszText.peer_namescGs |jj|jd|||f|dS)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.rNr)rerr rDrrrrrszText.replacecCs|j|jdd||dSrrrrrrrszText.scan_markcCs|j|jdd||dS)z~Adjust the view of the text to 10 times the
        difference between X and Y and the coordinates given in
        scan_mark.rrNrrrrrrszText.scan_dragtocCs|jdg}|r|d|r&|d|r4|d|rB|d|rP|d|
r^|d|	rv|d||	|r|d	d
kr|d|||||r||t|jt|S)zSearch PATTERN beginning from INDEX until STOPINDEX.
        Return the index of the first character of a match or an
        empty string.rz	-forwardsz
-backwardsz-exactz-regexpz-nocasez-elidez-countrr-r)rrcrr2rr)rerrZ	stopindexZforwardsZ	backwardsexactZregexpZnocaser{Zeliderrrrrs.












zText.searchcCs|j|jd|dS)z3Scroll such that the character at INDEX is visible.rNrrrrrrszText.seecGs |j|jdd||f|dS)z|Add tag TAGNAME to all characters between INDEX1 and index2 in ARGS.
        Additional pairs of indices may follow in ARGS.tagrNr)retagNamerrrrrtag_addszText.tag_addcCs*|j|jdd||d|r&||dS)zgUnbind for all characters with TAGNAME for event SEQUENCE  the
        function identified with FUNCID.rRrorZNrr)rerSrkrmrrrrszText.tag_unbindcCs||jdd|f|||S)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.rRrorp)rerSrkrrrrrrs
z
Text.tag_bindcCsJ|dddkrd|}|dddkr4|dd}|j|jdd||S)z+Return the value of OPTION for tag TAGNAME.Nrr-rrrRrr)rerSrrrrtag_cget	s
z
Text.tag_cgetcKs|dd|f||S)zConfigure a tag TAGNAME.rRrr)rerSr&rrrr
tag_configureszText.tag_configurecGs|j|jddf|dS)zDelete all tags in TAGNAMES.rRrNr)reZtagNamesrrr
tag_deleteszText.tag_deletecCs|j|jdd||dS)z`Change the priority of tag TAGNAME such that it is lower
        than the priority of BELOWTHIS.rRrNr)rerSrrrrrszText.tag_lowercCs|j|j|jdd|S)zReturn a list of all tag names.rRrrgrrrr	tag_names szText.tag_namesc
Cs |j|j|jdd|||S)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.rRZ	nextrangergrerSrr rrr
tag_nextrange%szText.tag_nextrangec
Cs |j|j|jdd|||S)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.rRZ	prevrangergrYrrr
tag_prevrange,szText.tag_prevrangecCs|j|jdd||dS)zaChange the priority of tag TAGNAME such that it is higher
        than the priority of ABOVETHIS.rRrNr)rerSrrrrr3szText.tag_raisecCs|j|j|jdd|S)z7Return a list of ranges of text which have tag TAGNAME.rRZrangesrg)rerSrrr
tag_ranges9szText.tag_rangescCs|j|jdd|||dS)zARemove tag TAGNAME from all characters between INDEX1 and INDEX2.rRrNrrYrrr
tag_remove>szText.tag_removecCsJ|dddkrd|}|dddkr4|dd}|j|jdd||S)z:Return the value of OPTION of an embedded window at INDEX.Nrr-rrrrrr
rrrwindow_cgetCs
zText.window_cgetcKs|dd|f||S)z&Configure an embedded window at INDEX.rrrrrrrwindow_configureKszText.window_configurecKs&|j|jdd|f|||dS)zCreate a window at INDEX.rr?Nrhrrrr
window_createQs

zText.window_createcCs|j|j|jddS)z4Return all names of embedded windows in this widget.rrrgrrrrwindow_namesWszText.window_namescGs|j|jddf|dS)zObsolete function, use see.rz
-pickplaceNr)rerprrryview_pickplace\szText.yview_pickplace)N)N)NN)N)N)N)N)NNNNNNNN)N)N)N)N)N)N)N)N)N)N):rArBrCrkrrr/r{r4rr6r8r9r;r<r>r?r@rrArBrCrrrrGrHrIrJrLrMrOrPrrrrrrTrrrUrVZ
tag_configrWrrXrZr[rr\r]r^r_Z
window_configr`rarbrrrrr.
s~


(







	







r.c@s"eZdZdZdddZddZdS)_setitz>Internal class. It wraps the command in the widget OptionMenu.NcCs||_||_||_dSr)
_setit__value_setit__var_setit__callback)revarr
rrrrrdsz_setit.__init__cGs*|j|j|jr&|j|jf|dSr)rerrdrfrrrrrisz_setit.__call__)Nrrrrrrcas
rcc@s(eZdZdZddZddZddZdS)	
OptionMenuz?OptionMenu which allows the user to select a value from a menu.c
Osd|dtddd}t||d|d|_t|ddd	}|_|j|_|d
}d
|kr\|d
=|rtt	dt
t||j|t
|||d|D]}	|j|	t
||	|dq||d<d
S)zConstruct an optionmenu widget with the parent MASTER, with
        the resource textvariable set to VARIABLE, the initially selected
        value VALUE, the other menu values VALUES and an additional
        keyword argument command.r,rr')ZborderwidthZtextvariableZindicatoronZreliefrZhighlightthicknessr'Z
tk_optionMenurr)rYZtearoffrzunknown option -)rrN)ZRAISEDrrr}r_OptionMenu__menurZmenunamerrrKr0rrc)
rerrr
rQkwargsrrrr*rrrrrs.


zOptionMenu.__init__cCs|dkr|jSt||S)Nr)rirrrrrrrszOptionMenu.__getitem__cCst|d|_dS)z,Destroy this widget and the associated menu.N)r&rrirrrrrs
zOptionMenu.destroyN)rArBrCrkrrrrrrrrhosrhc@sheZdZdZdZdidfddZddZdd	Zd
dZdd
Z	ddZ
e
ZddZddZ
ddZdS)ImagezBase class for images.rNc	Ksd|_|std}t|d||_|s>tjd7_dtjf}|rT|rTt||f}n|r\|}d}|D]*\}}t|r|	|}|d||f}qh|j
dd||f|||_dS)	Nzcreate imager2rz	pyimage%rrr-rr?)rYrrr`r2rk_last_idr+r%rrr)	reZimgtyperYr&rrrr)r*rrrrs$
zImage.__init__cCs|jSr)rYrrrrrFz
Image.__str__cCs6|jr2z|jdd|jWntk
r0YnXdS)Nrr)rYr2rrrrrrrs
z
Image.__del__cCs|j|jdd||dSNrr-r2rrYrrrrrszImage.__setitem__cCs|j|jdd|SrnrorrrrrszImage.__getitem__cKsvd}t|D]J\}}|dk	r|ddkr8|dd}t|rJ||}|d||f}q|j|jdf|dS)zConfigure the image.rNrrr-r)r+r%rrr2rrY)rerrr)r*rrrrs
zImage.configurecCs|j|jdd|jS)zReturn the height of the image.rrXr2rrrYrrrrrXszImage.heightcCs|jdd|jS)z7Return the type of the image, e.g. "photo" or "bitmap".rr rorrrrr sz
Image.typecCs|j|jdd|jS)zReturn the width of the image.rrWrprrrrrWszImage.width)rArBrCrkrlrrFrrrrrrXr rWrrrrrksrkc@seZdZdZdidfddZddZddZd	d
ZddZdddZ	dddZ
ddZdddZdddZ
ddZddZdS) 
PhotoImagez=Widget which can display images in PGM, PPM, GIF, PNG format.NcKstj|d|||f|dS)ztCreate an image with NAME.

        Valid resource names: data, format, file, gamma, height, palette,
        width.ZphotoNrkrrerYr&rrrrrrszPhotoImage.__init__cCs|j|jddS)zDisplay a transparent image.blankNrorrrrrtszPhotoImage.blankcCs|j|jdd|S)zReturn the value of OPTION.rr-ro)rerrrrrszPhotoImage.cgetcCs|j|jdd|S)Nrr-rorrrrrszPhotoImage.__getitem__cCs"t|jd}|j|d|j|S)z;Return a new PhotoImage with the same image as this widget.rcopyrqr2rrY)re	destImagerrrruszPhotoImage.copyrZcCs4t|jd}|dkr|}|j|d|jd|||S)zReturn 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.
        rrZruz-zoomrvrerUrVrwrrrzooms
zPhotoImage.zoomcCs4t|jd}|dkr|}|j|d|jd|||S)zReturn 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.
        rrZruz
-subsamplervrxrrr	subsamples
zPhotoImage.subsamplecCs|j|jd||S)z8Return the color (red, green, blue) of the pixel at X,Y.rrorrrrr	szPhotoImage.getcCsH|jd|f}|r8|ddkr(|dd}|dt|}|j|dS)zzPut row formatted colors to image starting from
        position TO, e.g. image.put("{red green} {blue yellow}", to=(4,6))putr-torN)r|rYrr2r)rerrrrrrr{
szPhotoImage.putcCs@|jd|f}|r|d|f}|r0|dt|}|j|dS)zRWrite image to file FILENAME in FORMAT starting from
        position FROM_COORDS.writez-format)z-fromNr})refilenameformatZfrom_coordsrrrrr~szPhotoImage.writec	Cs|j|j|jdd||S)z/Return True if the pixel at x,y is transparent.transparencyr)r2rrrYrrrrtransparency_get"szPhotoImage.transparency_getcCs|j|jdd|||dS)z)Set the transparency of the pixel at x,y.rrNro)rerUrVrrrrtransparency_set'szPhotoImage.transparency_set)rZ)rZ)N)NN)rArBrCrkrrtrrruryrzrr{r~rrrrrrrqs






rqc@s eZdZdZdidfddZdS)BitmapImagez.Widget which can display images in XBM format.NcKstj|d|||f|dS)zqCreate a bitmap with NAME.

        Valid resource names: background, data, file, foreground, maskdata, maskfile.rNrrrsrrrr/szBitmapImage.__init__rrrrrr,srcCstdj}||ddS)Nzuse image_names()rrrrr2r.rr2rrrr6s
rcCstdj}||ddS)Nzuse image_types()rrrrrrrr;s
rc@seZdZdZdifddZddZd+ddZd	d
ZddZd
dZ	ddZ
ddZddZddZ
ddZddZddZddZdd Zd,d!d"Zd#d$Zd%d&Zd'd(Zd)d*ZdS)-Spinboxzspinbox widget.NcKst||d||dS)aConstruct 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,
        ZspinboxNrrrrrrCszSpinbox.__init__cCs||j|jd|pdS)aReturn 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.
        rNr@rrrrr`szSpinbox.bboxcCs|j|jd||S)aWDelete 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.
        rrrrrrrns	zSpinbox.deletecCs|j|jdS)zReturns the spinbox's stringrrrrrrryszSpinbox.getcCs|j|jd|S)zAlter the position of the insertion cursor.

        The insertion cursor will be displayed just before
        the character given by index. Returns an empty string
        rrrrrrr}szSpinbox.icursorcCs|j|jd||S)z{Returns the name of the widget at position x, y

        Return value is one of: none, buttondown, buttonup, entry
        r,rrrrrr,szSpinbox.identifycCs|j|jd|S)z;Returns the numerical index corresponding to index
        rrrrrrrsz
Spinbox.indexcCs|j|jd||S)zDInsert string s at index

         Returns an empty string.
        rr)rerrfrrrrszSpinbox.insertcCs|j|jd|S)zCauses the specified element to be invoked

        The element could be buttondown or buttonup
        triggering the action associated with it.
        rrreelementrrrrszSpinbox.invokecGs ||j|jdf|pdS)rrrr@rrrrrs
zSpinbox.scancCs|d|S)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.
        rrr]rrrrszSpinbox.scan_markcCs|d|S)aCompute 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.
        rrr]rrrrs
zSpinbox.scan_dragtocGs ||j|jdf|pdS)rrrr@rrrrrs
zSpinbox.selectioncCs|d|S)aLocate 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.
        rrrrrrrszSpinbox.selection_adjustcCs
|dS)zsClear the selection

        If the selection isn't in this widget then the
        command has no effect.
        rrrrrrr
szSpinbox.selection_clearcCs|j|jdd|S)zSets or gets the currently selected element.

        If a spinbutton element is specified, it will be
        displayed depressed.
        rrrrrrrselection_elementszSpinbox.selection_elementcCs|d|dS)rrNrrrrrrszSpinbox.selection_fromcCs|j|j|jddS)zUReturn True if there are characters selected in the spinbox, False
        otherwise.rrr)rrrrrszSpinbox.selection_presentcCs|d||dS)rrNrrrrrrszSpinbox.selection_rangecCs|d|dS)rrNrrrrrrszSpinbox.selection_to)N)N)rArBrCrkrrrrrr,rrrrrrrrr
rrrrrrrrrr@s*
	
rc@seZdZdZdifddZdS)
LabelFramezlabelframe widget.NcKst||d||dS)aConstruct 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
        Z
labelframeNrrrrrrszLabelFrame.__init__rrrrrrsrc@seZdZdZdifddZddZddZeZd	d
ZddZ	d
dZ
ddZddZddZ
ddZddZddZddZd!ddZeZdd ZdS)"PanedWindowzpanedwindow widget.NcKst||d||dS)aTConstruct 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,
        ZpanedwindowNrrrrrr
szPanedWindow.__init__cKs"|j|jd|f||dS)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.
        rNrh)rer%rrrrrszPanedWindow.addcCs|j|jd|dS)zRemove the pane containing child from the panedwindow

        All geometry management options for child will be forgotten.
        rNr)rer%rrrr'szPanedWindow.removecCs|j|jd||S)aIdentify 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,rrrrrr,0s
zPanedWindow.identifycGs ||j|jdf|pdS)rproxyrr@rrrrr<s
zPanedWindow.proxycCs
|dS)zBReturn the x and y pair of the most recent proxy location
        coordrrrrrproxy_coordAszPanedWindow.proxy_coordcCs
|dS)z+Remove the proxy from the display.
        rrrrrrproxy_forgetFszPanedWindow.proxy_forgetcCs|d||S)z:Place the proxy at the given x and y coordinates.
        rrrrrrproxy_placeKszPanedWindow.proxy_placecGs ||j|jdf|pdS)rsashrr@rrrrrPs
zPanedWindow.sashcCs|d|S)aAReturn 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.
        rrrrrr
sash_coordUszPanedWindow.sash_coordcCs|d|S)zRecords x and y for the sash given by index;

        Used in conjunction with later dragto commands to move the sash.
        rrrrrr	sash_markcszPanedWindow.sash_markcCs|d|||S)z?Place the sash given by index at the given coordinates
        rr)rerrUrVrrr
sash_placejszPanedWindow.sash_placecCs|j|jdf|d|fS)zwQuery a management option for window.

        Option may be any value allowed by the paneconfigure subcommand
        panecgetr-r)rer%rrrrroszPanedWindow.panecgetcKsd|dkr|s||jd|St|tr@|s@||jd|d|S|j|jd|f|||dS)a
Query or modify the management options for window.

        If no option is specified, returns a list describing all
        of the available options for pathName.  If option is
        specified with no value, then the command returns a list
        describing the one named option (this list will be identical
        to the corresponding sublist of the value returned if no
        option is specified). If one or more option-value pairs are
        specified, then the command modifies the given widget
        option(s) to have the given value(s); in this case the
        command returns an empty string. 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
paneconfigurer-)rrrrrr2rrrrrrrwsD
zPanedWindow.paneconfigurecCs|j|j|jdS)z+Returns an ordered list of the child panes.panesrgrrrrrszPanedWindow.panes)N)rArBrCrkrrrrr,rrrrrrrrrrZ
paneconfigrrrrrr
s$

LrcCst}dt}|d7}t||d}|t|d|fddd}|||_t|d|jd}||||	|
dS)	NzThis is Tcl/Tk version %su
This should be a cedilla: çrz	Click me!cSs|jjd|jddS)Nz[%s]rr)testr)rqrrr<lambda>sz_test.<locals>.<lambda>)rrZQUIT)ro
TclVersionrrrDrrrr!rr)rqrrrrzrrr_tests 
r__main__)TN)N)r)r)NNror)VrkenumrrrZtkinter.constantsrer@floatrOZ	TkVersionrPrZREADABLEZWRITABLEZ	EXCEPTIONcompilerASCIIrr
rrr"r+r7rEnumr8rGrlrmrnrrruryrrzrrrrrrarrrrrrrrrorfrgrprurzrrrDrrrrrrrr&r(r*r+r-r.rcrhrkrqrrrrrrrrArrrr<module>s 





,R

	6

q2~
.37?/8$Vt!'2'BT
3C