m %UIc@sdZdZdkZeidjo dkZndkZeZeiZdkTdk Tydk Z e Z [ Wne j o e Z nXdZeeiZeeiZeiZeiZeiZy eiWnej oe e_nXy eiWnej oe e_nXdZy eiZWnej onXdZy eiZWnej onXdfd YZdae ad Zd Z d d Z!da"dfdYZ#de#fdYZ$de#fdYZ%de#fdYZ&de#fdYZ'ddZ(e)Z*eZ+dZ,dfdYZ-dfdYZ.dfd YZ/d!e-e/fd"YZ0e e d!dd#Z1d$fd%YZ2d&fd'YZ3d(fd)YZ4d*e-fd+YZ5d,e5e2e3e4fd-YZ6d.e5e/fd/YZ7d0e6fd1YZ8d2Z9d3Z:d4Z;d5Z<e d6Z=d7e6fd8YZ>d9e6fd:YZ?d;e6fd<YZ@d=e6fd>YZAd?e6fd@YZBdAe6fdBYZCdCe6fdDYZDdEe6fdFYZEdGe6fdHYZFdIe6fdJYZGdKe6fdLYZHdMe6fdNYZIdOe6fdPYZJdQfdRYZKdSeEfdTYZLdUfdVYZMdWeMfdXYZNdYeMfdZYZOd[ZPd\ZQd]e6fd^YZRd_e6fd`YZSdae6fdbYZTdce8fddYZUdee8fdfYZVdgZWeXdhjo eWndS(is2Wrapper 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 Tkconstants 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() s$Revision: 39220 $Ntwin32(t*icCsff}xY|D]Q}t|ttfjo|t|}q |dj o||f}q q W|S(sInternal function.N(tresttupletitemttypet TupleTypetListTypet_flattentNone(RRR((t+/data/zmath/lib/python2.4/lib-tk/Tkinter.pyR@s cCst|tjo|Snt|ttfjo|Snh}xst|D]e}y|i|WqOt t fj o9}dG|GHx)|i D]\}}|||R?((R ttrace_variablescCs3|iidd|i|||ii|dS(sDelete 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. R;tvdeleteN(R*R-R@R0RAR?R+t deletecommand(R*RAR?((R t trace_vdeletescCs4t|ii|ii|iidd|iS(s&Return all trace callback information.R;tvinfoN(tmapR*R-tsplitt splitlistR@R0(R*((R t trace_vinfos(RRRR2R R3R5R6R1R:RBR;RERJ(((R R&s       t StringVarcBs)tZdZdZedZdZRS(s#Value holder for strings variables.R'cCsti||dS(sKConstruct a string variable. MASTER can be given as master widget.N(R&R3R*R)(R*R)((R R3scCs7|ii|i}t|to|Snt|S(s#Return value of variable as string.N(R*R-R9R0R8t isinstancet basestringtstr(R*R8((R R:s (RRRR2R R3R:(((R RKs  tIntVarcBs2tZdZdZedZdZdZRS(s#Value holder for integer variables.icCsti||dS(sMConstruct an integer variable. MASTER can be given as master widget.N(R&R3R*R)(R*R)((R R3scCs0t|tot|}nti||S(s;Set the variable to value, converting booleans to integers.N(RLR8tbooltintR&R1R*(R*R8((R R1scCst|ii|iS(s/Return the value of the variable as an integer.N(tgetintR*R-R9R0(R*((R R:s(RRRR2R R3R1R:(((R ROs   t DoubleVarcBs)tZdZdZedZdZRS(s!Value holder for float variables.f0.0cCsti||dS(sLConstruct a float variable. MASTER can be given as a master widget.N(R&R3R*R)(R*R)((R R3scCst|ii|iS(s,Return the value of the variable as a float.N(t getdoubleR*R-R9R0(R*((R R: s(RRRR2R R3R:(((R RSs  t BooleanVarcBs)tZdZdZedZdZRS(s#Value holder for boolean variables.tfalsecCsti||dS(sNConstruct a boolean variable. MASTER can be given as a master widget.N(R&R3R*R)(R*R)((R R3scCs|ii|ii|iS(s+Return the value of the variable as a bool.N(R*R-t getbooleanR9R0(R*((R R:s(RRRR2R R3R:(((R RU s  cCstii|dS(sRun the main loop of Tcl.N(RR,tmainlooptn(RY((R RXscCstii|S(s1Convert true and false to integer values 1 and 0.N(RR,RWts(RZ((R RW"stMisccBstZdZeZdZdZedZdZdZ dZ ddZ e Z ed Z ed Zdd d Zdd ZeZeZdZdZeZdZdZdZdZdZdZdZedZdZ dZ!ddZ"dZ#dZ$dZ%dZ&d Z'd!Z(d"Z)ed#Z*ed$Z+d%Z,d&Z-ed'Z.d(Z/d)Z0d*Z1d+Z2d,Z3d-Z4ed.Z*ed/Z5e5Z6ed0Z7dd1Z8dd2Z9d3Z:d4Z;d5Z<d6Z=dd7Z>d8Z?d9Z@d:ZAd;ZBd<ZCd=ZDdd>ZEd?ZFd@ZGdAZHdBZIddCZJdDZKdEZLdFZMdGZNdHZOdIZPdJZQdKZRdLZSdMZTdNZUdOZVdPZWdQZXdRZYdSZZdTZ[dUZ\dVZ]dWZ^dXZ_dYZ`ddZZad[Zbd\Zcd]Zdd^Zed_Zfd`ZgdaZhdbZidcZjddZkdeZledfZmdgdhZneeediZoedjZpeeedkZqdlZreeedmZsdnZtddoZudpZvdqZwdrZxdsZydtZzeduZ{dvZ|e|Z}edgdwZ~e~ZdxZdZdieZdZdZdZedZeZdZeZdZdZdZdgZedZeZdZeZdZeeeedZeZdZhdZeZdZedZhdZeZdZeZeedZdZdZdZedZdZdZRS(sRInternal class. Base class which defines methods common for interior widgets.cCsE|idj o1x!|iD]}|ii|qWd|_ndS(skInternal function. Delete all Tcl commands created for this widget in the Tcl interpreter.N(R*t _tclCommandsR tnameR,RD(R*R]((R tdestroy.s  cCs>|ii|y|ii|Wntj onXdS(sDInternal function. Delete the Tcl command provided in NAME.N(R*R,RDR]R\tremovet ValueError(R*R]((R RD8s cCs"|ii|iidd|S(sSet 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.R1ttk_strictMotifN(R*R,RWR@tboolean(R*Rb((R RaBscCs|iiddS(sDChange the color scheme to light brown as used in Tk 3.6 and before.t tk_bisqueN(R*R,R@(R*((R RcKscOs.|iidt|t|idS(s Set a new color scheme for all widget elements. A single color as argument will cause that all colors of Tk widget elements are derived from this. Alternatively several keyword parameters and its associated colors can be given. The following keywords are valid: activeBackground, foreground, selectColor, activeForeground, highlightBackground, selectBackground, background, highlightColor, selectForeground, disabledForeground, insertBackground, troughColor.t tk_setPaletteN(s tk_setPalette(R*R,R@RtargstkwR(R*ReRf((R RdNs cGsdS(s)Do not use. Needed in Tk 3.6 and earlier.N((R*Re((R t tk_menuBar[sR(cCs|iidd|dS(sWait until the variable is modified. A parameter of type IntVar, StringVar, DoubleVar or BooleanVar must be given.ttkwaitR<N(R*R,R@R](R*R]((R t wait_variable^scCs4|djo |}n|iidd|idS(sQWait until a WIDGET is destroyed. If no parameter is given self is used.RhtwindowN(RjR R*R,R@t_w(R*Rj((R t wait_windowes  cCs4|djo |}n|iidd|idS(sxWait until the visibility of a WIDGET changes (e.g. it appears). If no parameter is given self is used.Rht visibilityN(RjR R*R,R@Rk(R*Rj((R twait_visibilityls  t1cCs|ii||dS(sSet Tcl variable NAME to VALUE.N(R*R,tsetvarR]R8(R*R]R8((R RptscCs|ii|S(s"Return value of Tcl variable NAME.N(R*R,tgetvarR](R*R]((R RqwscCs|ii|S(sPReturn a boolean value for Tcl boolean values true and false given as parameter.N(R*R,RWRZ(R*RZ((R RW|scCs|iid|idS(sDirect 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.tfocusN(R*R,R@Rk(R*((R t focus_setscCs|iidd|idS(stDirect input focus to this widget even if the application does not have the focus. Use with caution!Rrs-forceN(R*R,R@Rk(R*((R t focus_forcescCs<|iid}|djp| odSn|i|S(sReturn 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.RrtnoneN(R*R,R@R]R t _nametowidget(R*R]((R t focus_gets cCsE|iidd|i}|djp| odSn|i|S(sReturn 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.Rrs -displayofRuN(R*R,R@RkR]R Rv(R*R]((R tfocus_displayofs cCsE|iidd|i}|djp| odSn|i|S(syReturn the widget which would have the focus if top level for this widget gets the focus from the window manager.Rrs-lastforRuN(R*R,R@RkR]R Rv(R*R]((R t focus_lastfors cCs|iiddS(sXThe widget under mouse will get automatically focus. Can not be disabled easily.ttk_focusFollowsMouseN(R*R,R@(R*((R RzscCs4|iid|i}|pdSn|i|S(snReturn 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.t tk_focusNextN(R*R,R@RkR]R Rv(R*R]((R R{s cCs4|iid|i}|pdSn|i|S(sHReturn previous widget in the focus order. See tk_focusNext for details.t tk_focusPrevN(R*R,R@RkR]R Rv(R*R]((R R|s cGso|p|iid|nNg}||||d}|i|}|i ||iid||SdS(sCall 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.taftercCsAz||Wdy|i|dWntj onXXdS(Ni(tfuncReR*RDttmptTclError(R~ReR*R((R tcallitsN( R~R*R,R@tmsRReRR=R]tappend(R*RR~ReRRR]((R R}s cGs|id||S(sCall FUNC once if the Tcl main loop has no event to process. Return an identifier to cancel the scheduling with after_cancel.tidleN(R*R}R~Re(R*R~Re((R t after_idlescCsoy?|iidd|}|ii|d}|i|Wntj onX|iidd|dS(sCancel scheduling of function identified with ID. Identifier returned by after or after_idle must be given as first parameter.R}tinfoitcancelN( R*R,R@tidtdataRItscriptRDR(R*RRR((R t after_cancelsicCs!|iid|i|dS(sRing a display's bell.tbellN(sbell(R*R,R@t _displayoft displayof(R*R((R RscKsB|idp|i|d|idp|i|d 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 for pressing Control and mouse button 1 or for pressing A and the Alt key (KeyPress can be omitted). An event pattern can also be a virtual event of the form <> 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.tbindN(R*R6RkR1R~R(R*R1R~R((R R7~s%cCs8|iid|i|d|o|i|ndS(sWUnbind for this widget for event SEQUENCE the function identified with FUNCID.R7R'N(R*R,R@RkR1R4RD(R*R1R4((R tunbindscCs|id|||dS(sBind 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.R7talliN(sbindsall(R*R6R1R~R(R*R1R~R((R tbind_allscCs|iidd|ddS(s8Unbind for all widgets for event SEQUENCE all functions.R7R9R'N(R*R,R@R1(R*R1((R t unbind_allscCs|id|f|||dS(s=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.R7iN(R*R6RR1R~R(R*RR1R~R((R t bind_classscCs|iid||ddS(sYUnbind for a all widgets with bindtag CLASSNAME for event SEQUENCE all functions.R7R'N(R*R,R@RR1(R*RR1((R t unbind_classscCs|ii|dS(sCall the mainloop of Tk.N(R*R,RXRY(R*RY((R RXscCs|iidS(s8Quit the Tcl interpreter. All widgets will be destroyed.N(R*R,tquit(R*((R R>scCs.|o#ttt|ii|SndS(sInternal function.N(RRRGRRR*R,RI(R*R((R RscCs.|o#ttt|ii|SndS(sInternal function.N(RRRGRTR*R,RI(R*R((R t _getdoublesscCs|o|ii|SndS(sInternal function.N(RR*R,RW(R*R((R t _getbooleanscCs7|od|fSn|djod|ifSnfS(sInternal function.s -displayofN(RR R*Rk(R*R((R Rs  cCs|ot||f}n t|}f}x~|iD]p\}}|dj oW|ddjo|d }nt|o|i |}n|d||f}q<q<W|S(sInternal function.it_t-N( RfRRRRRRR tcallableR*R=(R*RRfRRR((R Rs    cCs|}|ddjo|i}|d}nx^|oV|id}|djo|| ||d}}nd}|i|}|}q4W|S(sPReturn the Tkinter instance of a widget identified by its Tcl name NAME.it.iR'N(R*twR]t_roottfindtittailR(R*R]RHRIRE((R t nametowidgets    cCst|||i}tt|}y |i }Wnt j onXy||i }Wnt j onX|i i |||o1|idjo g|_n|ii|n|S(sReturn 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(t CallWrapperR~tsubstR*t__call__tfR.RR]tim_funcRRR,t createcommandR3R\R R(R*R~RLR3R]RN((R R=s"  cCs%|}x|io |i}q W|S(sInternal function.N(R*RER)(R*RE((R RFs  s%#s%bs%fs%hs%ks%ss%ts%ws%xs%ys%As%Es%Ks%Ns%Ws%Ts%Xs%Ys%Dt cGst|t|ijo|Sn|ii}t}d}|\}}}}}}}}}}}}}} } } } } }t}|||_|||_y|||_ Wnt!j onX|||_"|||_#|||_$|||_%|||_&|||_|||_||_'y|||_(Wnt!j onX||_)|| |_*| |_+y|i,| |_-Wnt.j o| |_-nX|| |_/|| |_0y|||_1Wnt2j od|_1nX|fS(sInternal function.cCs,yt|SWntj o |SnXdS(s?Tk changed behavior in 8.4.2, returning "??" rather more often.N(RQRZR`(RZ((R t getint_event!s iN(3tlenReR*t _subst_formatR,RWRQRRRRtnsigntbRNthRRZRRERR)tAtEtKtNtWtTtXtYtDRtetserialtnumRrRRtkeycodetstatettimeR&tchart send_eventtkeysymt keysym_numRRvtwidgetRtx_rootty_roottdeltaR`(R*ReRRRWRURXRYR`RZR[R]R\R_R^RVRaRNRWRRRRZRRER)R((R R2sP  ?    cCsIdk}|i|i|i}}}|i}|i |||dS(sInternal function.N( tsystexc_typet exc_valuet exc_tracebacktexctvalttbR*RFtroottreport_callback_exception(R*RsRtRuRoRv((R t_report_exceptionTs   cCs>|ot||f}n|ot|}n|djokh}xZ|ii|iit|i |fD]+}|ddf|d||dd}sRzN(RGR*R,RHR@Rk(R*((R tkeys{s cCs|iS(s+Return the window path name of this widget.N(R*Rk(R*((R R6st_noarg_cCsV|tijo&|i|iidd|iSn|iidd|i|dS(sSet 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. tpackt propagateN(tflagR[RR*R@R,R@Rk(R*R((R tpack_propagates&cCs1t|i|ii|iidd|iS(sHReturn a list of all slaves of this widget in its packing order.RtslavesN(RGR*RvR,RIR@Rk(R*((R t pack_slavess cCs1t|i|ii|iidd|iS(sHReturn a list of all slaves of this widget in its packing order.tplaceRN(RGR*RvR,RIR@Rk(R*((R t place_slavess cCsdd|if}|dj o!|dj o|||f}n|dj o!|dj o|||f}n|i|i i |pdS(sReturn 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. tgridtbboxN( R*RkRetcolumnR trowtcol2trow2RR,R@(R*RRRRRe((R t grid_bboxs c Cst|tjoS| oK|ddjo|d }n|d djod|}n|f} n|i||} | p|iid||i |}|ii |} h} xtdt| dD]f}| |d}| |d}|p d }n*d|jot|}n t|}|| |     % cKs|id|||S(sConfigure 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).tcolumnconfigureN(R*RRRRf(R*RRRf((R tgrid_columnconfigurescCs/|i|iidd|i||pdS(sReturn 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.RtlocationN(R*RR,R@RkRR)R (R*RR)((R t grid_locationscCsV|tijo&|i|iidd|iSn|iidd|i|dS(sSet 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. RRN(RR[RR*R@R,R@Rk(R*R((R tgrid_propagates&cKs|id|||S(sConfigure 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).t rowconfigureN(R*RRRRf(R*RRRf((R tgrid_rowconfigurescCs)|i|iidd|ipdS(s<Return a tuple of the number of column and rows in the grid.RtsizeN(R*RR,R@RkR (R*((R t grid_sizescCsf}|dj o|d|f}n|dj o|d|f}nt|i|ii|ii dd|i f|S(sHReturn a list of all slaves of this widget in its packing order.s-rows-columnRRN( ReRR RRGR*RvR,RIR@Rk(R*RRRe((R t grid_slavess   cGs'dd|f|}|ii|dS(sBind a virtual event VIRTUAL (of the form <>) to an event SEQUENCE such that the virtual event is triggered whenever SEQUENCE occurs.teventRN(tvirtualt sequencesReR*R,R@(R*RRRe((R t event_addscGs'dd|f|}|ii|dS(s-Unbind a virtual event VIRTUAL from SEQUENCE.RtdeleteN(RRReR*R,R@(R*RRRe((R t event_deletescKs`dd|i|f}x4|iD]&\}}|d|t|f}q"W|i i |dS(sGenerate an event SEQUENCE. Additional keyword arguments specify parameter of the event (e.g. x, y, rootx, rooty).Rtgenerates-%sN( R*RkR1ReRfRRRRNR,R@(R*R1RfReRR((R tevent_generates  cCs"|ii|iidd|S(suReturn a list of all virtual events or the information about the SEQUENCE bound to the virtual event VIRTUAL.RRN(R*R,RIR@R(R*R((R t event_info#scCs|iiddS(s*Return a list of all existing image names.timagetnamesN(R*R,R@(R*((R t image_names+scCs|iiddS(s?Return a list of all available image types (e.g. phote bitmap).RttypesN(R*R,R@(R*((R t image_types/s(s%#s%bs%fs%hs%ks%ss%ts%ws%xs%ys%As%Es%Ks%Ns%Ws%Ts%Xs%Ys%D(RRRR R\R^RDRaRcRdRgRitwaitvarRlRnRpRqRQRRtfloatRTRWRsRrRtRwRxRyRzR{R|R}RRRRRRRRRRRRRRRRRRRRRRtliftRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR R RRRRRRRRR!R#R%R'R(R*RR,R-R6R7R8R:R;R<R=RXR>RR?R@RRRJRvR=tregisterRFRTtjoinR5R2RxRyRztconfigR{t __getitem__R}RR6RRRRRRRRRRRRRRRRRRRRRRRR(((R R['sB                                                                                        (             9            "        RKcBs tZdZdZdZRS(swInternal class. Stores function to call when some user defined Tcl function is called e.g. after an event occurred.cCs||_||_||_dS(s(Store FUNC, SUBST and WIDGET as members.N(R~R*RLRk(R*R~RLRk((R R37s  cGsfy.|io|i|}n|i|SWn1tj o}t|n|iinXdS(s3Apply first function SUBST to arguments, than FUNC.N(R*RLReR~R#RRkRx(R*ReR((R RM<s  (RRRR3RM(((R RK4s  tWmcBstZdZeeeedZeZdZeZedZeZ dZ e Z edZ e Z dZeZedZeZdZeZed ZeZeeeed ZeZed ZeZed ZeZd ZeZedZeZedZ e Z!eedZ"e"Z#edZ$e$Z%eedZ&e&Z'eedZ(e(Z)edZ*e*Z+edZ,e,Z-eedZ.e.Z/eedZ0e0Z1edZ2e2Z3edZ4e4Z5edZ6e6Z7edZ8e8Z9dZ:e:Z;RS(sAProvides functions for the communication with the window manager.c Cs.|i|iidd|i||||S(sInstruct 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.twmtaspectN( R*RR,R@RktminNumertminDenomtmaxNumertmaxDenom(R*RRRR((R t wm_aspectKscGs&dd|if|}|ii|S(sThis 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. Rt attributesN(R*RkReR,R@(R*Re((R t wm_attributesWscCs|iidd|i|S(sVStore NAME in WM_CLIENT_MACHINE property of this widget. Return current value.RtclientN(R*R,R@RkR](R*R]((R t wm_clientmscGsRt|djo |f}ndd|if|}t|i|ii|S(sStore 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.iRtcolormapwindowsN( RStwlistR*RkReRGRvR,R@(R*RRe((R twm_colormapwindowsrs  cCs|iidd|i|S(sStore VALUE in WM_COMMAND property. It is the command which shall be used to invoke the application. Return current command if VALUE is None.RRN(R*R,R@RkR8(R*R8((R t wm_command{scCs|iidd|iS(sDeiconify this widget. If it was never mapped it will not be mapped. On Windows it will raise this widget and give it the focus.Rt deiconifyN(R*R,R@Rk(R*((R t wm_deiconifyscCs|iidd|i|S(sSet 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.Rt focusmodelN(R*R,R@Rktmodel(R*R((R t wm_focusmodelscCs|iidd|iS(sAReturn identifier for decorative frame of this widget if present.RtframeN(R*R,R@Rk(R*((R twm_framescCs|iidd|i|S(siSet geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return current value if None is given.RRN(R*R,R@Rkt newGeometry(R*R((R t wm_geometrysc Cs.|i|iidd|i||||S(sInstruct 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.RRN( R*RR,R@Rkt baseWidtht baseHeighttwidthInct heightInc(R*RRRR((R twm_gridscCs|iidd|i|S(s~Set the group leader widgets for related widgets to PATHNAME. Return the group leader of this widget if None is given.RtgroupN(R*R,R@RktpathName(R*R((R twm_groupscCs|iidd|i|S(sZSet bitmap for the iconified widget to BITMAP. Return the bitmap if None is given.Rt iconbitmapN(R*R,R@Rktbitmap(R*R((R t wm_iconbitmapscCs|iidd|iS(sDisplay widget as icon.RticonifyN(R*R,R@Rk(R*((R t wm_iconifyscCs|iidd|i|S(sVSet mask for the icon bitmap of this widget. Return the mask if None is given.RticonmaskN(R*R,R@RkR(R*R((R t wm_iconmaskscCs|iidd|i|S(sSSet the name of the icon for this widget. Return the name if None is given.RticonnameN(R*R,R@RktnewName(R*R((R t wm_iconnamescCs(|i|iidd|i||S(sSet 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.Rt iconpositionN(R*RR,R@RkRR)(R*RR)((R twm_iconpositionscCs|iidd|i|S(sgSet widget PATHNAME to be displayed instead of icon. Return the current value if None is given.Rt iconwindowN(R*R,R@RkR(R*R((R t wm_iconwindowscCs(|i|iidd|i||S(sSet 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.RtmaxsizeN(R*RR,R@RkR&R(R*R&R((R t wm_maxsizescCs(|i|iidd|i||S(sSet 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.RtminsizeN(R*RR,R@RkR&R(R*R&R((R t wm_minsizescCs%|i|iidd|i|S(sInstruct the window manager to ignore this widget if BOOLEAN is given with 1. Return the current value if None is given.RtoverrideredirectN(R*R@R,R@RkRb(R*Rb((R twm_overrideredirectscCs|iidd|i|S(sInstruct 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".Rt positionfromN(R*R,R@Rktwho(R*R((R twm_positionfromscCsEt|o|i|}n|}|iidd|i||S(sBind 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".RtprotocolN( RCR~R*R=RR,R@RkR](R*R]R~R((R t wm_protocols  cCs|iidd|i||S(syInstruct the window manager whether this width can be resized in WIDTH or HEIGHT. Both values are boolean values.Rt resizableN(R*R,R@RkR&R(R*R&R((R t wm_resizablescCs|iidd|i|S(sInstruct 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".RtsizefromN(R*R,R@RkR(R*R((R t wm_sizefromscCs|iidd|i|S(sQuery or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).RReN(R*R,R@Rktnewstate(R*R((R twm_statescCs|iidd|i|S(sSet the title of this widget.RttitleN(R*R,R@RkR(R*R((R twm_titlescCs|iidd|i|S(s_Instruct the window manager that this widget is transient with regard to widget MASTER.Rt transientN(R*R,R@RkR)(R*R)((R t wm_transientscCs|iidd|iS(sWithdraw this widget from the screen such that it is unmapped and forgotten by the window manager. Re-draw it with wm_deiconify.RtwithdrawN(R*R,R@Rk(R*((R t wm_withdraws(<RRRR RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRReRRRRRR(((R RHsr                         tTkcBsetZdZdZeedddedZdZdZdZd Z d Z d Z RS( syToplevel widget of Tk which represents mostly the main window of an appliation. It has an associated Tcl interpreter.RDRiic Csd|_h|_d|_d|_|djobdk}dk} | i i |i d}| i i |\}}|djo||}qnd} ti|||| t||||_|o|in|i||dS(s@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.iNs.pys.pycs.pyo(s.pys.pycs.pyo(R R*R)Rt _tkloadedR,tbaseNameRotostpathtbasenametargvtsplitexttextt interactivet_tkintertcreatet screenNameRt wantobjectstuseTktsynctuset_loadtkt readprofile( R*RRRR R R RoRRR((R R3 s       'cCs)|ip|ii|indS(N(R*RR,tloadtkR (R*((R R%s  cCssd|_to.ttdotidd|in|iid}|t i jot dt i |fnt |iid}|t ijot dt i|fntdjot d t tn|idjo g|_n|iid t|iid t|iid |iid tot o |an|id |idS( Nit SchedParamsit tk_versions4tk.h version (%s) doesn't match libtk.a version (%s)t tcl_versions6tcl.h version (%s) doesn't match libtcl.a version (%s)f4.0s)Tk 4.0 or higher is required; found Tk %sttkerrortexittWM_DELETE_WINDOW(R*Rt_MacOSthasattrRRR,RqRRt TK_VERSIONt RuntimeErrorRNRt TCL_VERSIONt TkVersionR\R RPR!R%RRRRR^(R*RR((R R )s,    cCsix!|iiD]}|iqW|iid|iti|t ot |jo da ndS(shDestroy this and all descendants widgets. This will end the application of this Tcl interpreter.R^N( R*RtvaluesRR^R,R@RkR[RRR (R*R((R R^Ns c BsQdk}|iido|id}n |i}|ii|d|}|ii|d|}|ii|d|}|ii|d|}hd|<} d| U|ii|o|iid|n|ii|oe|| n|ii|o|iid|n|ii|oe|| ndS(sInternal function. It reads BASENAME.tcl and CLASSNAME.tcl into the Tcl Interpreter and calls execfile on BASENAME.py and CLASSNAME.py if such a file exists in the home directory.NtHOMEs.%s.tcls.%s.pyR*sfrom Tkinter import *tsource(RtenvironRthometcurdirRRRt class_tcltclass_pyRtbase_tcltbase_pyR*tdirtisfileR,R@texecfile( R*RRR#R$R"R!RRR%((R R Ws&  cCsTdk}dk}|iid||_||_||_ |i |||dS(s6Internal function. It reports exception on sys.stderr.NsException in Tkinter callback ( t tracebackRotstderrtwriteRst last_typeRtt last_valueRutlast_tracebacktprint_exception(R*RsRtRuR(Ro((R Rwls   cCst|i|S(s3Delegate attribute access to the interpreter objectN(tgetattrR*R,tattr(R*R0((R t __getattr__ts( RRRRkR R3RR R^R RwR1(((R R s   %  cCst||||S(N(RRRRR (RRRR ((R tTclstPackcBs`tZdZhdZeZZZdZeZdZ e Z e i Z Z e iZZRS(sQGeometry manager Pack. Base class to use the methods pack_* in every widget.cKs0|iidd|if|i||dS(sPack 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 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. RRzN(R*R,R@RkRRRf(R*RRf((R tpack_configurescCs|iidd|idS(s:Unmap this widget and do not use it for the packing order.RtforgetN(R*R,R@Rk(R*((R t pack_forgetscCs|ii|iidd|i}h}xjtdt|dD]P}||d}||d}|d djo|i |}n|||dgD]3}|i|o||||d <||=q q W|iidd|if|i||dS(sPlace a widget in the parent widget. Use as options: in=master - master relative to which the widget is placed. 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 tin_iRRzN( RRfRR*R,R@RkRR(R*RRfR((R tplace_configures cCs|iidd|idS(sUnmap this widget.RR5N(R*R,R@Rk(R*((R t place_forgetscCs|ii|iidd|i}h}xjtdt|dD]P}||d}||d}|d djo|i |}n|||RRzRR[RRRRR?R5R@RARRRRRRRRRRR(((R R=s           t BaseWidgetcBs>tZdZdZhhfdZdZfdZRS(sInternal class.cCsto)|ptp tant}q0n||_|i|_d}|i do|d}|d=n|pt t |}n||_ |i djod||_ n|i d||_ h|_|iii |i o|ii|i in||ii|i d9Z?d:Z@d;ZAd<ZBd=ZCd>ZDd?ZERS(@s?Canvas widget to display graphical elements like lines or text.cKsti||d||dS(sConstruct 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.tcanvasN(RIR3R*R)RRf(R*R)RRf((R R3s cGs!|ii|idf|dS(sInternal function.taddtagN(R*R,R@RkRe(R*Re((R RcscCs|i|d|dS(s*Add tag NEWTAG to all items above TAGORID.taboveN(R*RctnewtagttagOrId(R*ReRf((R t addtag_abovescCs|i|ddS(sAdd tag NEWTAG to all items.R9N(R*RcRe(R*Re((R t addtag_allscCs|i|d|dS(s*Add tag NEWTAG to all items below TAGORID.tbelowN(R*RcReRf(R*ReRf((R t addtag_belowscCs |i|d||||dS(sAdd 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.tclosestN(R*RcReRR)thalotstart(R*ReRR)RlRm((R taddtag_closestscCs |i|d||||dS(sLAdd tag NEWTAG to all items in the rectangle defined by X1,Y1,X2,Y2.tenclosedN(R*RcRetx1ty1tx2ty2(R*ReRpRqRrRs((R taddtag_enclosedscCs |i|d||||dS(sWAdd tag NEWTAG to all items which overlap the rectangle defined by X1,Y1,X2,Y2.t overlappingN(R*RcReRpRqRrRs(R*ReRpRqRrRs((R taddtag_overlappingscCs|i|d|dS(s)Add tag NEWTAG to all items with TAGORID.twithtagN(R*RcReRf(R*ReRf((R taddtag_withtagscGs-|i|ii|idf|pdS(s|Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle which encloses all items with tags specified as arguments.RN(R*RR,R@RkReR (R*Re((R RscCs;|ii|id||d|o|i|ndS(sbUnbind for all items with TAGORID for event SEQUENCE the function identified with FUNCID.R7R'N(R*R,R@RkRfR1R4RD(R*RfR1R4((R t tag_unbindscCs"|i|id|f|||S(s&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.R7N(R*R6RkRfR1R~R(R*RfR1R~R((R ttag_bindscCs"t|ii|id||S(srReturn the canvas x coordinate of pixel position SCREENX rounded to nearest multiple of GRIDSPACING units.tcanvasxN(RTR*R,R@Rktscreenxt gridspacing(R*R|R}((R R{scCs"t|ii|id||S(srReturn the canvas y coordinate of pixel position SCREENY rounded to nearest multiple of GRIDSPACING units.tcanvasyN(RTR*R,R@RktscreenyR}(R*RR}((R R~ scGs2tt|ii|ii|idf|S(s8Return a list of coordinates for the item given in ARGS.tcoordsN(RGRTR*R,RIR@RkRe(R*Re((R Rsc Csut|}|d}t|ttfjo|d }nh}t|ii |i d|||i ||S(sInternal function.iRN(RReRRR RRRR*R,R@RktitemTypeRRf(R*RReRfR((R t_creates  cOs|id||S(s6Create arc shaped region with coordinates x1,y1,x2,y2.tarcN(R*RReRf(R*ReRf((R t create_arcscOs|id||S(s%Create bitmap with coordinates x1,y1.RN(R*RReRf(R*ReRf((R t create_bitmap"scOs|id||S(s)Create image item with coordinates x1,y1.RN(R*RReRf(R*ReRf((R t create_image%scOs|id||S(s-Create line with coordinates x1,y1,...,xn,yn.tlineN(R*RReRf(R*ReRf((R t create_line(scOs|id||S(s)Create oval with coordinates x1,y1,x2,y2.tovalN(R*RReRf(R*ReRf((R t create_oval+scOs|id||S(s0Create polygon with coordinates x1,y1,...,xn,yn.tpolygonN(R*RReRf(R*ReRf((R tcreate_polygon.scOs|id||S(s.Create rectangle with coordinates x1,y1,x2,y2.t rectangleN(R*RReRf(R*ReRf((R tcreate_rectangle1scOs|id||S(s#Create text with coordinates x1,y1.ttextN(R*RReRf(R*ReRf((R t create_text4scOs|id||S(s+Create window with coordinates x1,y1,x2,y2.RjN(R*RReRf(R*ReRf((R t create_window7scGs!|ii|idf|dS(sDelete characters of text items identified by tag or id in ARGS (possibly several times) from FIRST to LAST character (including).tdcharsN(R*R,R@RkRe(R*Re((R R:scGs!|ii|idf|dS(s<Delete items identified by all tag or ids contained in ARGS.RN(R*R,R@RkRe(R*Re((R R>scGs!|ii|idf|dS(siDelete tag or id given as last arguments in ARGS from items identified by first argument in ARGS.tdtagN(R*R,R@RkRe(R*Re((R RAscGs-|i|ii|idf|pfS(sInternal function.RGN(R*RR,R@RkRe(R*Re((R RGEscCs|id|S(sReturn items above TAGORID.RdN(R*RGRf(R*Rf((R t find_aboveIscCs |idS(sReturn all items.R9N(R*RG(R*((R tfind_allLscCs|id|S(sReturn all items below TAGORID.RiN(R*RGRf(R*Rf((R t find_belowOscCs|id||||S(sReturn 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.RkN(R*RGRR)RlRm(R*RR)RlRm((R t find_closestRscCs|id||||S(s=Return all items in rectangle defined by X1,Y1,X2,Y2.RoN(R*RGRpRqRrRs(R*RpRqRrRs((R t find_enclosedXscCs|id||||S(sLReturn all items which overlap the rectangle defined by X1,Y1,X2,Y2.RuN(R*RGRpRqRrRs(R*RpRqRrRs((R tfind_overlapping\scCs|id|S(sReturn all items with TAGORID.RwN(R*RGRf(R*Rf((R t find_withtag`scGs|ii|idf|S(s.Set focus to the first item specified in ARGS.RrN(R*R,R@RkRe(R*Re((R RrcscGs)|ii|ii|idf|S(s=Return tags associated with the first item specified in ARGS.tgettagsN(R*R,RIR@RkRe(R*Re((R RfscGs!|ii|idf|dS(sdSet cursor at position POS in the item identified by TAGORID. In ARGS TAGORID must be first.ticursorN(R*R,R@RkRe(R*Re((R RjscGs#t|ii|idf|S(s?Return position of cursor as integer in item specified in ARGS.RN(RRR*R,R@RkRe(R*Re((R RnscGs!|ii|idf|dS(sSInsert TEXT in item TAGORID at position POS. ARGS must be TAGORID POS TEXT.R[N(R*R,R@RkRe(R*Re((R R[qscCs'|ii|idf|d|fS(s9Return the resource value for an OPTION for item TAGORID.titemcgetRBN(R*R,R@RkRfR(R*RfR((R RuscKs|id|f||S(sConfigure 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. t itemconfigureN(R*RyRfRRf(R*RfRRf((R RyscGs!|ii|idf|dS(sJLower an item TAGORID given in ARGS (optional below another item).RN(R*R,R@RkRe(R*Re((R t tag_lowerscGs!|ii|idf|dS(s#Move an item TAGORID given in ARGS.tmoveN(R*R,R@RkRe(R*Re((R RscKs)|ii|idf|i||S(sPrint the contents of the canvas to a postscript file. Valid options: colormap, colormode, file, fontmap, height, pageanchor, pageheight, pagewidth, pagex, pagey, rotate, witdh, x, y.t postscriptN(R*R,R@RkRRRf(R*RRf((R RscGs!|ii|idf|dS(sJRaise an item TAGORID given in ARGS (optional above another item).RN(R*R,R@RkRe(R*Re((R t tag_raisescGs!|ii|idf|dS(s9Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE.tscaleN(R*R,R@RkRe(R*Re((R RscCs#|ii|idd||dS(s&Remember the current X, Y coordinates.tscantmarkN(R*R,R@RkRR)(R*RR)((R t scan_marksi cCs&|ii|idd|||dS(sAdjust the view of the canvas to GAIN times the difference between X and Y and the coordinates given in scan_mark.RtdragtoN(R*R,R@RkRR)tgain(R*RR)R((R t scan_dragtoscCs#|ii|idd||dS(sLAdjust the end of the selection near the cursor of an item TAGORID to index.tselecttadjustN(R*R,R@RkRfR(R*RfR((R t select_adjustscCs|ii|idddS(s,Clear the selection if it is in this widget.RRN(R*R,R@Rk(R*((R t select_clearscCs#|ii|idd||dS(s:Set the fixed end of a selection in item TAGORID to INDEX.RtfromN(R*R,R@RkRfR(R*RfR((R t select_fromscCs |ii|iddpdS(s(Return the item which has the selection.RRN(R*R,R@RkR (R*((R t select_itemscCs#|ii|idd||dS(s=Set the variable end of a selection in item TAGORID to INDEX.RttoN(R*R,R@RkRfR(R*RfR((R t select_toscCs |ii|id|pdS(s$Return the type of the item TAGORID.RN(R*R,R@RkRfR (R*Rf((R RscGsK|p#|i|ii|idSn|ii|idf|dS(s1Query and change horizontal position of the view.txviewN(ReR*R?R,R@Rk(R*Re((R Rs#cCs |ii|idd|dS(ssAdjusts the view in the window so that FRACTION of the total width of the canvas is off-screen to the left.RtmovetoN(R*R,R@Rktfraction(R*R((R t xview_movetoscCs#|ii|idd||dS(sTShift the x-view according to NUMBER which is measured in "units" or "pages" (WHAT).RtscrollN(R*R,R@RkRR0(R*RR0((R t xview_scrollscGsK|p#|i|ii|idSn|ii|idf|dS(s/Query and change vertical position of the view.tyviewN(ReR*R?R,R@Rk(R*Re((R Rs#cCs |ii|idd|dS(ssAdjusts the view in the window so that FRACTION of the total height of the canvas is off-screen to the top.RRN(R*R,R@RkR(R*R((R t yview_movetoscCs#|ii|idd||dS(sTShift the y-view according to NUMBER which is measured in "units" or "pages" (WHAT).RRN(R*R,R@RkRR0(R*RR0((R t yview_scrolls(FRRRR R3RcRgRhRjRnRtRvRxRRyRzR{R~RRRRRRRRRRRRRRRGRRRRRRRRrRRRR[RRt itemconfigRRRRRRRRRRRRRRRRRRRRRR(((R Ras                                                          t CheckbuttoncBsJtZdZehdZdZdZdZdZdZ RS(s7Checkbutton widget which is either in on- or off-state.cKsti||d||dS(sConstruct 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.t checkbuttonN(RIR3R*R)RRf(R*R)RRf((R R3s cCs|ii|iddS(sPut the button in off-state.tdeselectN(R*R,R@Rk(R*((R RscCs|ii|iddS(sFlash the button.RWN(R*R,R@Rk(R*((R RWscCs|ii|idS(s<Toggle the button and invoke a command if given as resource.RXN(R*R,R@Rk(R*((R RXscCs|ii|iddS(sPut the button in on-state.RN(R*R,R@Rk(R*((R RscCs|ii|iddS(sToggle the button.ttoggleN(R*R,R@Rk(R*((R Rs( RRRR R3RRWRXRR(((R Rs     tEntrycBstZdZehdZedZdZdZdZdZ dZ dZ d Z e Z d ZeZd ZeZd ZeZd ZeZdZeZdZdZdZRS(s1Entry widget which allows to display simple text.cKsti||d||dS(sConstruct 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.tentryN(RIR3R*R)RRf(R*R)RRf((R R3s cCs |ii|id||dS(s.Delete text from FIRST to LAST (not included).RN(R*R,R@Rktfirsttlast(R*RR((R RscCs|ii|idS(sReturn the text.R:N(R*R,R@Rk(R*((R R:scCs|ii|id|dS(sInsert cursor at INDEX.RN(R*R,R@RkR(R*R((R R scCst|ii|id|S(sReturn position of cursor.RN(RRR*R,R@RkR(R*R((R R scCs |ii|id||dS(sInsert STRING at INDEX.R[N(R*R,R@RkRR(R*RR((R R[ scCs |ii|idd|dS(s&Remember the current X, Y coordinates.RRN(R*R,R@RkR(R*R((R R scCs |ii|idd|dS(sAdjust the view of the canvas to 10 times the difference between X and Y and the coordinates given in scan_mark.RRN(R*R,R@RkR(R*R((R R scCs |ii|idd|dS(s9Adjust the end of the selection near the cursor to INDEX.RRN(R*R,R@RkR(R*R((R tselection_adjust scCs|ii|idddS(s,Clear the selection if it is in this widget.RRN(R*R,R@Rk(R*((R R scCs |ii|idd|dS(s*Set the fixed end of a selection to INDEX.RRN(R*R,R@RkR(R*R((R tselection_from scCs%|ii|ii|iddS(s,Return whether the widget has the selection.RtpresentN(R*R,RWR@Rk(R*((R tselection_present scCs#|ii|idd||dS(s3Set the selection from START to END (not included).RRN(R*R,R@RkRmRY(R*RmRY((R tselection_range$ scCs |ii|idd|dS(s-Set the variable end of a selection to INDEX.RRN(R*R,R@RkR(R*R((R t selection_to( scCs|ii|id|dS(s1Query and change horizontal position of the view.RN(R*R,R@RkR(R*R((R R, scCs |ii|idd|dS(sqAdjust the view in the window so that FRACTION of the total width of the entry is off-screen to the left.RRN(R*R,R@RkR(R*R((R R/ scCs#|ii|idd||dS(sTShift the x-view according to NUMBER which is measured in "units" or "pages" (WHAT).RRN(R*R,R@RkRR0(R*RR0((R R3 s(RRRR R3RR:RRR[RRRRRRRRRtselect_presentRt select_rangeRRRRR(((R Rs0                tFramecBstZdZehdZRS(sFFrame widget which may contain other widgets and can have a 3D border.cKst||f}f}|idod|df}|d=n,|idod|df}|d=nti||d|h|dS(sConstruct 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.RKs-classRRN( RRRfRGRRIR3R*R)(R*R)RRfRG((R R39 s  (RRRR R3(((R R7 s tLabelcBstZdZehdZRS(s0Label widget which can display text and bitmaps.cKsti||d||dS(sConstruct 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 tlabelN(RIR3R*R)RRf(R*R)RRf((R R3K s(RRRR R3(((R RI s tListboxcBs"tZdZehdZdZdZdZedZedZ dZ dZ d Z d Z d Zd Zd ZeZedZeZdZeZedZeZdZdZdZdZdZdZdZdZedZ e Z!RS(s3Listbox widget which can display a list of strings.cKsti||d||dS(sConstruct 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.tlistboxN(RIR3R*R)RRf(R*R)RRf((R R3a scCs|ii|id|dS(s"Activate item identified by INDEX.tactivateN(R*R,R@RkR(R*R((R Rj scGs-|i|ii|idf|pdS(svReturn a tuple of X1,Y1,X2,Y2 coordinates for a rectangle which encloses the item identified by index in ARGS.RN(R*RR,R@RkReR (R*Re((R Rm scCs"|ii|ii|idS(s2Return list of indices of currently selected item.t curselectionN(R*R,RIR@Rk(R*((R Rr scCs |ii|id||dS(s/Delete items from FIRST to LAST (not included).RN(R*R,R@RkRR(R*RR((R Rw scCsP|o,|ii|ii|id||Sn|ii|id|SdS(s4Get list of items from FIRST to LAST (not included).R:N(RR*R,RIR@RkR(R*RR((R R:z s,cCs:|ii|id|}|djodSnt|S(s+Return index of item identified with INDEX.RRuN(R*R,R@RkRRHR RR(R*RRH((R R s  cGs$|ii|id|f|dS(sInsert ELEMENTS at INDEX.R[N(R*R,R@RkRtelements(R*RR((R R[ scCst|ii|id|S(s5Get index of item which is nearest to y coordinate Y.tnearestN(RRR*R,R@RkR)(R*R)((R R scCs#|ii|idd||dS(s&Remember the current X, Y coordinates.RRN(R*R,R@RkRR)(R*RR)((R R scCs#|ii|idd||dS(sAdjust the view of the listbox to 10 times the difference between X and Y and the coordinates given in scan_mark.RRN(R*R,R@RkRR)(R*RR)((R R scCs|ii|id|dS(s"Scroll such that INDEX is visible.tseeN(R*R,R@RkR(R*R((R R scCs |ii|idd|dS(s-Set the fixed end oft the selection to INDEX.RtanchorN(R*R,R@RkR(R*R((R tselection_anchor scCs#|ii|idd||dS(s6Clear the selection from FIRST to LAST (not included).RRN(R*R,R@RkRR(R*RR((R R scCs(|ii|ii|idd|S(s+Return 1 if INDEX is part of the selection.RtincludesN(R*R,RWR@RkR(R*R((R tselection_includes scCs#|ii|idd||dS(smSet the selection from FIRST to LAST (not included) without changing the currently selected elements.RR1N(R*R,R@RkRR(R*RR((R t selection_set scCst|ii|idS(s-Return the number of elements in the listbox.RN(RRR*R,R@Rk(R*((R R scGsK|p#|i|ii|idSn|ii|idf|dS(s1Query and change horizontal position of the view.RN(R0R*R?R,R@Rk(R*R0((R R s#cCs |ii|idd|dS(sqAdjust the view in the window so that FRACTION of the total width of the entry is off-screen to the left.RRN(R*R,R@RkR(R*R((R R scCs#|ii|idd||dS(sTShift the x-view according to NUMBER which is measured in "units" or "pages" (WHAT).RRN(R*R,R@RkRR0(R*RR0((R R scGsK|p#|i|ii|idSn|ii|idf|dS(s/Query and change vertical position of the view.RN(R0R*R?R,R@Rk(R*R0((R R s#cCs |ii|idd|dS(spAdjust the view in the window so that FRACTION of the total width of the entry is off-screen to the top.RRN(R*R,R@RkR(R*R((R R scCs#|ii|idd||dS(sTShift the y-view according to NUMBER which is measured in "units" or "pages" (WHAT).RRN(R*R,R@RkRR0(R*RR0((R R scCs'|ii|idf|d|fS(s4Return the resource value for an ITEM and an OPTION.RRBN(R*R,R@RkRR(R*RR((R R scKs|id|f||S(s9Configure 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.RN(R*RyRRRf(R*RRRf((R R s("RRRR R3RRRRR:RR[RRRRRt select_anchorRRRtselect_includesRt select_setRRRRRRRRRR(((R R_ s>                         tMenucBstZdZehdZdZdZdZdZdZ dZ dZ d Z d Z d Zd Zd dZdZhdZhdZhdZhdZhdZhdZhdZhdZhdZhdZhdZhdZedZdZedZ e Z!dZ"d Z#d!Z$d"Z%d#Z&d$Z'RS(%sPMenu widget which allows to display menu bars, pull-down menus and pop-up menus.cKsti||d||dS(sAConstruct 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.tmenuN(RIR3R*R)RRf(R*R)RRf((R R3 scCsdS(N((R*((R ttk_bindForTraversal scCs|iid|idS(Nt tk_mbPost(R*R,R@Rk(R*((R R scCs|iiddS(Nt tk_mbUnpost(R*R,R@(R*((R R scCs|iid|i|dS(Nttk_traverseToMenu(R*R,R@RkRg(R*Rg((R R scCs|iid|i|dS(Nttk_traverseWithinMenu(R*R,R@RkRg(R*Rg((R R scCs|iid|iS(Nttk_getMenuButtons(R*R,R@Rk(R*((R R scCs|iid|dS(Nt tk_nextMenu(R*R,R@tcount(R*R((R R scCs|iid|dS(Nttk_nextMenuEntry(R*R,R@R(R*R((R R scCs|iid|idS(Nt tk_invokeMenu(R*R,R@Rk(R*((R R scCs|iid|idS(Nt tk_firstMenu(R*R,R@Rk(R*((R R scCs|iid|idS(Nttk_mbButtonDown(R*R,R@Rk(R*((R R sR'cCs#|iid|i|||dS(s/Post the menu at position X,Y with entry ENTRY.ttk_popupN(R*R,R@RkRR)R(R*RR)R((R R scCs|ii|id|dS(sActivate entry at INDEX.RN(R*R,R@RkR(R*R((R R scKs0|ii|id|f|i||dS(sInternal function.RN(R*R,R@RkRRRRf(R*RRRf((R R scKs|id|p|dS(sAdd hierarchical menu item.tcascadeN(R*RRRf(R*RRf((R t add_cascade scKs|id|p|dS(sAdd checkbutton menu item.RN(R*RRRf(R*RRf((R tadd_checkbutton scKs|id|p|dS(sAdd command menu item.RN(R*RRRf(R*RRf((R t add_command scKs|id|p|dS(sAddd radio menu item.t radiobuttonN(R*RRRf(R*RRf((R tadd_radiobutton scKs|id|p|dS(sAdd separator.t separatorN(R*RRRf(R*RRf((R t add_separator scKs3|ii|id||f|i||dS(sInternal function.R[N( R*R,R@RkRRRRRf(R*RRRRf((R R[ scKs|i|d|p|dS(s$Add hierarchical menu item at INDEX.RN(R*R[RRRf(R*RRRf((R tinsert_cascade scKs|i|d|p|dS(s#Add checkbutton menu item at INDEX.RN(R*R[RRRf(R*RRRf((R tinsert_checkbutton scKs|i|d|p|dS(sAdd command menu item at INDEX.RN(R*R[RRRf(R*RRRf((R tinsert_command scKs|i|d|p|dS(sAddd radio menu item at INDEX.RN(R*R[RRRf(R*RRRf((R tinsert_radiobutton scKs|i|d|p|dS(sAdd separator at INDEX.RN(R*R[RRRf(R*RRRf((R tinsert_separator scCs |ii|id||dS(s;Delete menu items between INDEX1 and INDEX2 (not included).RN(R*R,R@Rktindex1tindex2(R*RR((R R! scCs |ii|id|d|S(s>Return the resource value of an menu item for OPTION at INDEX.t entrycgetRBN(R*R,R@RkRR(R*RR((R R$ scKs|id|f||S(sConfigure a menu item at INDEX.tentryconfigureN(R*RyRRRf(R*RRRf((R R' scCs:|ii|id|}|djodSnt|S(s4Return the index of a menu item identified by INDEX.RRuN(R*R,R@RkRRHR RR(R*RRH((R R+ s  cCs|ii|id|S(sRInvoke a menu item identified by INDEX and execute the associated command.RXN(R*R,R@RkR(R*R((R RX0 scCs |ii|id||dS(sDisplay a menu at position X,Y.tpostN(R*R,R@RkRR)(R*RR)((R R4 scCs|ii|id|S(s*Return the type of the menu item at INDEX.RN(R*R,R@RkR(R*R((R R7 scCs|ii|iddS(s Unmap a menu.tunpostN(R*R,R@Rk(R*((R R: scCst|ii|id|S(sEReturn the y-position of the topmost pixel of the menu item at INDEX.t ypositionN(RRR*R,R@RkR(R*R((R R= s((RRRR R3RRRRRRRRRRRRRRRRRRRR[RRRRRRRRt entryconfigRRXRRRR(((R R sJ                                  t MenubuttoncBstZdZehdZRS(s(Menubutton widget, obsolete since Tk8.0.cKsti||d||dS(Nt menubutton(RIR3R*R)RRf(R*R)RRf((R R3D s(RRRR R3(((R RB s tMessagecBstZdZehdZRS(sKMessage widget to display multiline text. Obsolete since Label does it too.cKsti||d||dS(Ntmessage(RIR3R*R)RRf(R*R)RRf((R R3I s(RRRR R3(((R RG s t RadiobuttoncBsAtZdZehdZdZdZdZdZRS(sGRadiobutton widget which shows only one of several buttons in on-state.cKsti||d||dS(sConstruct 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.RN(RIR3R*R)RRf(R*R)RRf((R R3N s cCs|ii|iddS(sPut the button in off-state.RN(R*R,R@Rk(R*((R RY scCs|ii|iddS(sFlash the button.RWN(R*R,R@Rk(R*((R RW] scCs|ii|idS(s<Toggle the button and invoke a command if given as resource.RXN(R*R,R@Rk(R*((R RX` scCs|ii|iddS(sPut the button in on-state.RN(R*R,R@Rk(R*((R Rc s( RRRR R3RRWRXR(((R RL s    tScalecBsDtZdZehdZdZdZedZdZRS(s1Scale widget which can display a numerical scale.cKsti||d||dS(sConstruct 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.RN(RIR3R*R)RRf(R*R)RRf((R R3i scCsJ|ii|id}yt|SWntj ot|SnXdS(s*Get the current value as integer or float.R:N(R*R,R@RkR8RRR`RT(R*R8((R R:s s cCs|ii|id|dS(sSet the value to VALUE.R1N(R*R,R@RkR8(R*R8((R R1z scCs"|i|ii|id|S(sReturn 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.RN(R*RR,R@RkR8(R*R8((R R} scCs|ii|id||S(scReturn where the point X,Y lies. Valid return values are "slider", "though1" and "though2".tidentifyN(R*R,R@RkRR)(R*RR)((R R  s( RRRR R3R:R1RR (((R Rg s    t ScrollbarcBsStZdZehdZdZdZdZdZdZ dZ RS(s?Scrollbar widget which displays a slider at a certain position.cKsti||d||dS(slConstruct 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.t scrollbarN(RIR3R*R)RRf(R*R)RRf((R R3 scCs|ii|id|dS(sxDisplay the element at INDEX with activebackground and activerelief. INDEX can be "arrow1","slider" or "arrow2".RN(R*R,R@RkR(R*R((R R scCs"t|ii|id||S(snReturn the fractional change of the scrollbar setting if it would be moved by DELTAX or DELTAY pixels.RnN(RTR*R,R@Rktdeltaxtdeltay(R*R R ((R Rn scCs"t|ii|id||S(sRReturn the fractional value which corresponds to a slider position of X,Y.RN(RTR*R,R@RkRR)(R*RR)((R R scCs|ii|id||S(sYReturn the element under position X,Y as one of "arrow1","slider","arrow2" or "".R N(R*R,R@RkRR)(R*RR)((R R  scCs|i|ii|idS(sZReturn the current fractional values (upper and lower end) of the slider position.R:N(R*R?R,R@Rk(R*((R R: scGs!|ii|idf|dS(siSet the fractional values of the slider position (upper and lower ends as value between 0 and 1).R1N(R*R,R@RkRe(R*Re((R R1 s( RRRR R3RRnRR R:R1(((R R  s      tTextcBs{tZdZehdZdZdZdZdZdZ dZ edZ ed Z d Z eed Zd Zed ZdZdZdZdZedZdZedZhdZdZdZdZedZdZdZdZdZ dZ!dZ"d Z#eeeeeeed!Z$d"Z%d#Z&ed$Z'ed%Z(d&Z)ed'Z*e*Z+d(Z,ed)Z-ed*Z.ed+Z/ed,Z0ed-Z1d.Z2ed/Z3d0Z4ed1Z5e5Z6hd2Z7d3Z8d4Z9d5Z:d6Z;d7Z<d8Z=d9Z>d:Z?RS(;s4Text widget which can display text in various forms.cKsti||d||dS(sConstruct 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, RN(RIR3R*R)RRf(R*R)RRf((R R3 scGs-|i|ii|idf|pdS(sReturn a tuple of (x,y,width,height) which gives the bounding box of the visible part of the character at the index in ARGS.RN(R*RR,R@RkReR (R*Re((R R scCs|iid|i|dS(Nttk_textSelectTo(R*R,R@RkR(R*R((R R scCs|iid|idS(Nttk_textBackspace(R*R,R@Rk(R*((R R scCs#|iid|i|||dS(Nttk_textIndexCloser(R*R,R@RkR\RVR(R*R\RVR((R R scCs|iid|i|dS(Nttk_textResetAnchor(R*R,R@RkR(R*R((R R scCs+|ii|ii|id|||S(sReturn whether between index INDEX1 and index INDEX2 the relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.tcompareN(R*R,RWR@RkRtopR(R*RRR((R R scCs%|ii|ii|id|S(sjTurn on the internal consistency checks of the B-Tree inside the text widget according to BOOLEAN.tdebugN(R*R,RWR@RkRb(R*Rb((R R scCs |ii|id||dS(s?Delete the characters between INDEX1 and INDEX2 (not included).RN(R*R,R@RkRR(R*RR((R R scCs"|i|ii|id|S(sReturn 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.t dlineinfoN(R*RR,R@RkR(R*R((R R sc Ksg}d}d}|pg}|d} | }nzt|tp|i |}}n|d|g7}x.|D]&}||o|i d|qvqvW|i ||o|i |n|ii|id||SWd|o|i|nXdS(sReturn 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.cCs|i|||fdS(N(RRR|R8R(R|R8RR((R t append_triple ss-commandRBtdumpN(ReR t func_nameRRRRLRNR*R=RfR|RRRR,R@RkRD( R*RRRRfR|RReRR((R R s0     cGs-|i|ii|idf|pfS(srInternal 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 teditN(R*RR,R@RkRe(R*Re((R R s cCs|id|S(s;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. tmodifiedN(R*Rtarg(R*R((R t edit_modified! scCs |idS(s 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. tredoN(R*R(R*((R t edit_redo, scCs |idS(s(Clears the undo and redo stacks tresetN(R*R(R*((R t edit_reset6 scCs |idS(snInserts a separator (boundary) on the undo stack. Does nothing when the undo option is false RN(R*R(R*((R tedit_separator; scCs |idS(sDUndoes 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 tundoN(R*R(R*((R t edit_undoB scCs|ii|id||S(s5Return the text from INDEX1 to INDEX2 (not included).R:N(R*R,R@RkRR(R*RR((R R:M scCs]|d djod|}n|ddjo|d }n|ii|idd||S(s9Return the value of OPTION of an embedded image at INDEX.iRBiRARR{N(RR*R,R@RkR(R*RR((R t image_cgetQ s cKs|idd|f||S(s%Configure an embedded image at INDEX.RRzN(R*RyRRRf(R*RRRf((R timage_configureX scKs+|ii|idd||i||S(s"Create an embedded image at INDEX.RRN(R*R,R@RkRRRRf(R*RRRf((R t image_create[ scCs|ii|iddS(s3Return all names of embedded images in this widget.RRN(R*R,R@Rk(R*((R R` scCs|ii|id|S(s1Return the index in the form line.char for INDEX.RN(R*R,R@RkR(R*R((R Rc scGs'|ii|id||f|dS(sInsert CHARS before the characters at INDEX. An additional tag can be given in ARGS. Additional CHARS and tags can follow in ARGS.R[N(R*R,R@RkRtcharsRe(R*RR(Re((R R[f scCs"|ii|idd||fS(sChange the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT). Return the current value if None is given for DIRECTION.RtgravityN(R*R,R@RktmarkNamet direction(R*R*R+((R t mark_gravityj scCs%|ii|ii|iddS(sReturn all mark names.RRN(R*R,RIR@Rk(R*((R t mark_nameso scCs#|ii|idd||dS(s0Set mark MARKNAME before the character at INDEX.RR1N(R*R,R@RkR*R(R*R*R((R tmark_sets scGs$|ii|iddf|dS(sDelete all marks in MARKNAMES.RtunsetN(R*R,R@Rkt markNames(R*R0((R t mark_unsetv scCs#|ii|idd|pdS(s-Return the name of the next mark after INDEX.RtnextN(R*R,R@RkRR (R*R((R t mark_nexty scCs#|ii|idd|pdS(s2Return the name of the previous mark before INDEX.RtpreviousN(R*R,R@RkRR (R*R((R t mark_previous| scCs#|ii|idd||dS(s&Remember the current X, Y coordinates.RRN(R*R,R@RkRR)(R*RR)((R R scCs#|ii|idd||dS(s~Adjust the view of the text to 10 times the difference between X and Y and the coordinates given in scan_mark.RRN(R*R,R@RkRR)(R*RR)((R R sc Cs|idg} |o| idn|o| idn|o| idn|o| idn|o| idn| o| id| i| n|dd jo| id n| i|| i||o| i|n|i it| S( sSearch PATTERN beginning from INDEX until STOPINDEX. Return the index of the first character of a match or an empty string.tsearchs -forwardss -backwardss-exacts-regexps-nocases-countiRBs--N(R*RkRetforwardsRt backwardstexacttregexptnocaseRRRt stopindexR,R@R( R*RRR<R7R8R9R:R;RRe((R R6 s*  cCs|ii|id|dS(s3Scroll such that the character at INDEX is visible.RN(R*R,R@RkR(R*R((R R scGs*|ii|idd||f|dS(s|Add tag TAGNAME to all characters between INDEX1 and index2 in ARGS. Additional pairs of indices may follow in ARGS.ttagRN(R*R,R@RkttagNameRRe(R*R>RRe((R ttag_add scCs>|ii|idd||d|o|i|ndS(sgUnbind for all characters with TAGNAME for event SEQUENCE the function identified with FUNCID.R=R7R'N(R*R,R@RkR>R1R4RD(R*R>R1R4((R Ry s"cCs%|i|idd|f|||S(s+Bind to all characters with TAGNAME at event SEQUENCE a call to function FUNC. An additional boolean parameter ADD specifies whether FUNC will be called additionally to the other bound function or whether it will replace the previous function. See bind for the return value.R=R7N(R*R6RkR>R1R~R(R*R>R1R~R((R Rz scCs]|d djod|}n|ddjo|d }n|ii|idd||S(s+Return the value of OPTION for tag TAGNAME.iRBiRAR=R{N(RR*R,R@RkR>(R*R>R((R ttag_cget s cKs|idd|f||S(sConfigure a tag TAGNAME.R=RzN(R*RyR>RRf(R*R>RRf((R t tag_configure scGs$|ii|iddf|dS(sDelete all tags in TAGNAMES.R=RN(R*R,R@RkttagNames(R*RB((R t tag_delete scCs#|ii|idd||dS(s`Change the priority of tag TAGNAME such that it is lower than the priority of BELOWTHIS.R=RN(R*R,R@RkR>R(R*R>R((R R scCs(|ii|ii|idd|S(sReturn a list of all tag names.R=RN(R*R,RIR@RkR(R*R((R t tag_names scCs.|ii|ii|idd|||S(sReturn a list of start and end index for the first sequence of characters between INDEX1 and INDEX2 which all have tag TAGNAME. The text is searched forward from INDEX1.R=t nextrangeN(R*R,RIR@RkR>RR(R*R>RR((R t tag_nextrange scCs.|ii|ii|idd|||S(sReturn a list of start and end index for the first sequence of characters between INDEX1 and INDEX2 which all have tag TAGNAME. The text is searched backwards from INDEX1.R=t prevrangeN(R*R,RIR@RkR>RR(R*R>RR((R t tag_prevrange scCs#|ii|idd||dS(saChange the priority of tag TAGNAME such that it is higher than the priority of ABOVETHIS.R=RN(R*R,R@RkR>R(R*R>R((R R scCs(|ii|ii|idd|S(s7Return a list of ranges of text which have tag TAGNAME.R=trangesN(R*R,RIR@RkR>(R*R>((R t tag_ranges scCs&|ii|idd|||dS(sARemove tag TAGNAME from all characters between INDEX1 and INDEX2.R=R_N(R*R,R@RkR>RR(R*R>RR((R t tag_remove scCs]|d djod|}n|ddjo|d }n|ii|idd||S(s:Return the value of OPTION of an embedded window at INDEX.iRBiRARjR{N(RR*R,R@RkR(R*RR((R t window_cget s cKs|idd|f||S(s&Configure an embedded window at INDEX.RjRzN(R*RyRRRf(R*RRRf((R twindow_configure scKs3|ii|idd|f|i||dS(sCreate a window at INDEX.RjRN(R*R,R@RkRRRRf(R*RRRf((R t window_create scCs%|ii|ii|iddS(s4Return all names of embedded windows in this widget.RjRN(R*R,RIR@Rk(R*((R t window_names scGsK|p#|i|ii|idSn|ii|idf|dS(s1Query and change horizontal position of the view.RN(R0R*R?R,R@Rk(R*R0((R R s#cCs |ii|idd|dS(ssAdjusts the view in the window so that FRACTION of the total width of the canvas is off-screen to the left.RRN(R*R,R@RkR(R*R((R R scCs#|ii|idd||dS(s\Shift the x-view according to NUMBER which is measured in "units" or "pages" (WHAT).RRN(R*R,R@RkRR0(R*RR0((R R scGsK|p#|i|ii|idSn|ii|idf|dS(s/Query and change vertical position of the view.RN(R0R*R?R,R@Rk(R*R0((R R s#cCs |ii|idd|dS(ssAdjusts the view in the window so that FRACTION of the total height of the canvas is off-screen to the top.RRN(R*R,R@RkR(R*R((R R scCs#|ii|idd||dS(s\Shift the y-view according to NUMBER which is measured in "units" or "pages" (WHAT).RRN(R*R,R@RkRR0(R*RR0((R R scGs$|ii|iddf|dS(sObsolete function, use see.Rs -pickplaceN(R*R,R@RkR0(R*R0((R tyview_pickplace s(@RRRR R3RRRRRRRRRRRRRR!R"R$R:R%R&R'RRR[R,R-R.R1R3R5RRR6RR?RyRzR@RAt tag_configRCRRDRFRHRRJRKRLRMt window_configRNRORRRRRRRP(((R R sz          (                                          t_setitcBs#tZdZedZdZRS(s>Internal class. It wraps the command in the widget OptionMenu.cCs||_||_||_dS(N(R8R*t _setit__valuetvart _setit__varR>t_setit__callback(R*RUR8R>((R R3 s  cGs8|ii|i|io|i|i|ndS(N(R*RVR1RTRWRe(R*Re((R RM s (RRRR R3RM(((R RS s  t OptionMenucBs)tZdZdZdZdZRS(s?OptionMenu which allows the user to select a value from a menu.c Os5hdd<d|<dd<dt<dd<d d<} ti||d | d |_t|d d dd}|_ |i |_ |id}|ido |d=n|otd|idn|id|dt|||x0|D](}|id|dt|||qW||d RRRRR8RSRR( R*R)R<R8RRcRRR>Rf((R R3 s$<     cCs(|djo |iSnti||S(NR(R]R*RaRIR(R*R]((R R6 s  cCsti|d|_dS(s,Destroy this widget and the associated menu.N(RR^R*R Ra(R*((R R^; s (RRRR3RR^(((R RX s   tImagecBsttZdZdZehedZdZdZdZdZ dZ e Z dZ d Z d ZRS( sBase class for images.ic Ks@d|_|pt}|p tdq.n|i|_|pFtid7_dtif}|ddjod|d}qn|o|ot ||f}n|o |}nf}xN|i D]@\}}t|o|i|}n|d||f}qW|iidd||f|||_dS( NsToo early to create imageis pyimage%riRBRARR(R R*R]R)RRR,Rdt_last_idRfRRRRRRRCR=R@timgtype( R*RfR]RR)RfRRR((R R3C s.      cCs|iS(N(R*R](R*((R R6Y scCsE|io7y|iidd|iWqAtj oqAXndS(NRR(R*R]R,R@R(R*((R R5Z s  cCs$|ii|idd||dS(NRzRB(R*R,R@R]R|R8(R*R|R8((R R}a scCs|ii|idd|S(NRzRB(R*R,R@R]R|(R*R|((R Rc scKsf}xt|iD]p\}}|dj oW|ddjo|d }nt|o|i |}n|d||f}qqW|i i |i df|dS(sConfigure the image.iRARBRN( RRRfRRRR RCR*R=R,R@R](R*RfRRR((R Rze s   cCst|iidd|iS(sReturn the height of the image.RRN(RRR*R,R@R](R*((R Rp scCs|iidd|iS(s8Return the type of the imgage, e.g. "photo" or "bitmap".RRN(R*R,R@R](R*((R Rt scCst|iidd|iS(sReturn the width of the image.RR&N(RRR*R,R@R](R*((R R&w s(RRRReR R3R6R5R}RRzRRRR&(((R Rd@ s        t PhotoImagecBstZdZehedZdZdZdZdZddZ ddZ d Z ed Z eed Z RS( s?Widget which can display colored images in GIF, PPM/PGM format.cKs ti|d||||dS(stCreate an image with NAME. Valid resource names: data, format, file, gamma, height, palette, width.tphotoN(RdR3R*R]RR)Rf(R*R]RR)Rf((R R3~ scCs|ii|iddS(sDisplay a transparent image.tblankN(R*R,R@R](R*((R Ri scCs|ii|idd|S(sReturn the value of OPTION.R{RBN(R*R,R@R]R(R*R((R R{ scCs|ii|idd|S(NR{RB(R*R,R@R]R|(R*R|((R R scCs&t}|ii|d|i|S(s;Return a new PhotoImage with the same image as this widget.tcopyN(Rgt destImageR*R,R@R](R*Rk((R Rj s R'cCsFt}|djo |}n|ii|d|id|||S(s\Return a new PhotoImage with the same image as this widget but zoom it with X and Y.R'Rjs-zoomN(RgRkR)RR*R,R@R](R*RR)Rk((R tzoom s   "cCsFt}|djo |}n|ii|d|id|||S(skReturn a new PhotoImage based on the same image as this widget but use only every Xth or Yth pixel.R'Rjs -subsampleN(RgRkR)RR*R,R@R](R*RR)Rk((R t subsample s   "cCs|ii|id||S(s8Return the color (red, green, blue) of the pixel at X,Y.R:N(R*R,R@R]RR)(R*RR)((R R: scCsd|id|f}|o7|ddjo|d}n|dt|}n|ii|dS(syPut row formated colors to image starting from position TO, e.g. image.put("{red green} {blue yellow}", to=(4,6))tputis-toiN(s-to(R*R]RReRRR,R@(R*RRRe((R Rn scCs`|id|f}|o|d|f}n|o|dt|}n|ii|dS(sRWrite image to file FILENAME in FORMAT starting from position FROM_COORDS.R*s-formats-fromN(s-from( R*R]tfilenameRetformatt from_coordsRR,R@(R*RoRpRqRe((R R* s(RRRR R3RiR{RRjRlRmR:RnR*(((R Rg| s         t BitmapImagecBs tZdZehedZRS(s"Widget which can display a bitmap.cKs ti|d||||dS(sqCreate a bitmap with NAME. Valid resource names: background, data, file, foreground, maskdata, maskfile.RN(RdR3R*R]RR)Rf(R*R]RR)Rf((R R3 s(RRRR R3(((R Rr s cCstiiddS(NRR(RR,R@(((R R scCstiiddS(NRR(RR,R@(((R R stSpinboxcBstZdZehdZdZedZdZdZdZ dZ dZ d Z d Z d Zd Zd ZdZdZedZRS(sspinbox widget.cKsti||d||dS(sConstruct 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, tspinboxN(RIR3R*R)RRf(R*R)RRf((R R3 scCs|ii|id|S(sReturn 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. RN(R*R,R@RkR(R*R((R R s cCs|ii|id||S(sWDelete 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. RN(R*R,R@RkRR(R*RR((R R scCs|ii|idS(sReturns the spinbox's stringR:N(R*R,R@Rk(R*((R R: scCs|ii|id|S(sAlter the position of the insertion cursor. The insertion cursor will be displayed just before the character given by index. Returns an empty string RN(R*R,R@RkR(R*R((R R scCs|ii|id||S(s{Returns the name of the widget at position x, y Return value is one of: none, buttondown, buttonup, entry R N(R*R,R@RkRR)(R*RR)((R R  scCs|ii|id|S(s;Returns the numerical index corresponding to index RN(R*R,R@RkR(R*R((R R scCs|ii|id||S(sDInsert string s at index Returns an empty string. R[N(R*R,R@RkRRZ(R*RRZ((R R[ scCs|ii|id|S(sCauses the specified element to be invoked The element could be buttondown or buttonup triggering the action associated with it. RXN(R*R,R@Rktelement(R*Ru((R RX scGs-|i|ii|idf|pfS(sInternal function.RN(R*RR,R@RkRe(R*Re((R R# scCs|id|S(sRecords 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. RN(R*RR(R*R((R R( scCs|id|S(sCompute 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. RN(R*RR(R*R((R R1 s cGs-|i|ii|idf|pfS(sInternal function.RN(R*RR,R@RkRe(R*Re((R R= scCs|id|S(sLocate 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. Returns an empty string. RN(R*RR(R*R((R RB s cCs |idS(sClear the selection If the selection isn't in this widget then the command has no effect. Returns an empty string. RN(R*R(R*((R RP scCs|id|S(sSets or gets the currently selected element. If a spinbutton element is specified, it will be displayed depressed RuN(R*RRu(R*Ru((R tselection_elementX s(RRRR R3RRR:RR RR[RXRRRRRRRv(((R Rs s"            t LabelFramecBstZdZehdZRS(slabelframe widget.cKsti||d||dS(sConstruct 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 t labelframeN(RIR3R*R)RRf(R*R)RRf((R R3d s(RRRR R3(((R Rwb s t PanedWindowcBstZdZehdZdZdZeZdZdZ dZ dZ dZ d Z d Zd Zd Zd ZedZeZdZRS(spanedwindow widget.cKsti||d||dS(sTConstruct 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, t panedwindowN(RIR3R*R)RRf(R*R)RRf((R R3z s cKs-|ii|id|f|i|dS(s!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. Options may have any of the values accepted by the configure subcommand. RN(R*R,R@RkRRRf(R*RRf((R R scCs|ii|id|dS(sRemove the pane containing child from the panedwindow All geometry management options for child will be forgotten. R5N(R*R,R@RkR(R*R((R R_ scCs|ii|id||S(sIdentify 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 N(R*R,R@RkRR)(R*RR)((R R  s cGs-|i|ii|idf|pfS(sInternal function.tproxyN(R*RR,R@RkRe(R*Re((R R{ scCs |idS(sBReturn the x and y pair of the most recent proxy location tcoordN(R*R{(R*((R t proxy_coord scCs |idS(s+Remove the proxy from the display. R5N(R*R{(R*((R t proxy_forget scCs|id||S(s:Place the proxy at the given x and y coordinates. RN(R*R{RR)(R*RR)((R t proxy_place scGs-|i|ii|idf|pfS(sInternal function.tsashN(R*RR,R@RkRe(R*Re((R R scCs|id|S(sAReturn the current x and y pair for the sash given by index. Index must be an integer between 0 and 1 less than the number of panes in the panedwindow. The coordinates given are those of the top left corner of the region containing the sash. pathName sash dragto index x y This command computes the difference between the given coordinates and the coordinates given to the last sash coord command for the given sash. It then moves that sash the computed difference. The return value is the empty string. R|N(R*RR(R*R((R t sash_coord s cCs|id|S(sRecords x and y for the sash given by index; Used in conjunction with later dragto commands to move the sash. RN(R*RR(R*R((R t sash_mark scCs|id|||S(s?Place the sash given by index at the given coordinates RN(R*RRRR)(R*RRR)((R t sash_place scCs'|ii|idf|d|fS(swQuery a management option for window. Option may be any value allowed by the paneconfigure subcommand tpanecgetRBN(R*R,R@RkRR(R*RR((R R scKs|djom| oeh}xT|ii|ii|id|D]+}|ddf|d||dds s<1>s( RIR3R*R)RRfR7RQRSRTRU(R*R)RRf((R R3>s (RRR R3(((R R=st TributtoncBstZdhdZRS(NcKsti||d|||id|i|id|i|id|i |id|i |d|d<|d|ds s<1>stbgtfgtactivebackground( RIR3R*R)RRfR7RQRSRTRU(R*R)RRf((R R3Fs(RRR R3(((R REscCst}dt}tdjo1y|tdd}WqQtj oqQXnt|d|}|it |ddd|d}|i||_ t |dd d|i }|i|i |i|i|idS( NsThis is Tcl/Tk version %sf8.0999999999999996s This should be a cedilla: s iso-8859-1Rs Click me!RcCs|iidd|idS(NRs[%s](RvttestRz(Rv((R R~^stQUIT(RRvt TclVersionRtunicodet NameErrorRRRRORR^R>RRRRX(R>RRRRv((R t_testRs(             t__main__(YRt __version__RotplatformtFixTkRttkinterRRt TkconstantstMacOSRt ImportErrorR RRRRRRtREADABLEtWRITABLEt EXCEPTIONtcreatefilehandlerRtdeletefilehandlerRRRRRRR!R%R/R&RKRORSRURXRQRRRTRWR[RKRRR2R3R8R=RBRIRJRORZR]R^R_R`RaRRRRRRRRRRR RRSRXRdRgRrRRRsRwRyRRRR(HRRRRXRRSRRRRRwRRORKRBRR^R]RRWRZRRRJRRdRRRRR=RR&RSRRRORaRRURyRgRR!RIRRoRTR RRRR3RXR_RsRRrRRRR[RKRRRR2RR`RR8R%R((R t?s              ,  8   ~,546>      Jvm!(a %<<