PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  mYz@sLdZddlZddlZejZddlTddlZdZeejZ eej Z ej Z ej Z ejZejdZejdejZddZd d Zd d Zy ejZWnek rYnXd dZy ejZWnek rYnXddddZGdddZdadaddZddZdddZdaGdddZ Gddde Z!Gddde Z"Gd d!d!e Z#Gd"d#d#e Z$dd$d%Z%e&Z'eZ(d&d'Z)Gd(d)d)Z*Gd*d+d+Z+Gd,d-d-Z,Gd.d/d/Z-Gd0d1d1Z.Gd2d3d3e*e.Z/ddd3dd4d5Z0Gd6d7d7Z1Gd8d9d9Z2Gd:d;d;Z3Gd<d=d=e*Z4Gd>d?d?e4e1e2e3Z5Gd@dAdAe4e.Z6GdBdCdCe5Z7GdDdEdEe5e,e-Z8GdFdGdGe5Z9GdHdIdIe5e,Z:GdJdKdKe5Z;GdLdMdMe5Z<GdNdOdOe5e,e-Z=GdPdQdQe5Z>GdRdSdSe5Z?GdTdUdUe5Z@GdVdWdWe5ZAGdXdYdYe5ZBGdZd[d[e5ZCGd\d]d]e5e,e-ZDGd^d_d_ZEGd`dadae?ZFGdbdcdcZGGdddedeeGZHGdfdgdgeGZIdhdiZJdjdkZKGdldmdme5e,ZLGdndodoe5ZMGdpdqdqe5ZNdrdsZOePdtkrHeOdS)ua8Wrapper 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])cCsdjtt|S)zInternal function. )joinmap _stringify)valuer '/opt/python35/lib/python3.5/__init__.py_join6sr cCst|ttfrgt|dkrTt|d}|ddkrdd|}qdt|}nzt|}|sd}n_tj|rtj d|}t j d|}n)|ddkst j|rd|}|S)zInternal function.rr{z{%s}z{}z\\\1") isinstancelisttuplelenrr str _magic_researchsub _space_re)rr r r r:s    rcCs\f}xO|D]G}t|ttfr;|t|}q |dk r ||f}q W|S)zInternal function.N)rrr_flatten)seqresitemr r r rOs  rcCst|tr|St|tdtfr2|Si}xt|D]y}y|j|WqEttfk r}z9td|x$|j D]\}}|||6s z(Variable.trace_vinfo..r]Zvinfo)rIr*rOrJ)rQr )rQr rj4szVariable.trace_vinfocCs(|jj|jjko'|j|jkS)zComparison for equality (==). Note: if the Variable's master matters to behavior also compare self._master == other._master ) __class__r5rJ)rQotherr r r __eq__8szVariable.__eq__)r5r6r7r8rPrIrUrTrWrXrZrMr\rir]rnrjrtr r r r rCs       rCc@s=eZdZdZdZdddddZddZdS) StringVarz#Value holder for strings variables.rDNcCstj||||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. N)rCrT)rQrRrrSr r r rTDs zStringVar.__init__cCs2|jj|j}t|tr(|St|S)z#Return value of variable as string.)rIr[rJrr)rQrr r r r\Psz StringVar.get)r5r6r7r8rPrTr\r r r r ruAs  ruc@s=eZdZdZdZdddddZddZdS)IntVarz#Value holder for integer variables.rNcCstj||||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. N)rCrT)rQrRrrSr r r rTZs zIntVar.__init__c Cs^|jj|j}y|jj|SWn.ttfk rYt|jj|SYnXdS)z/Return the value of the variable as an integer.N)rIr[rJgetintrTclErrorr> getdouble)rQrr r r r\fs z IntVar.get)r5r6r7r8rPrTr\r r r r rvWs  rvc@s=eZdZdZdZdddddZddZdS) DoubleVarz!Value holder for float variables.gNcCstj||||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. N)rCrT)rQrRrrSr r r rTqs zDoubleVar.__init__cCs|jj|jj|jS)z,Return the value of the variable as a float.)rIryr[rJ)rQr r r r\}sz DoubleVar.get)r5r6r7r8rPrTr\r r r r rzns  rzc@sOeZdZdZdZdddddZddZeZdd ZdS) BooleanVarz#Value holder for boolean variables.FNcCstj||||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. N)rCrT)rQrRrrSr r r rTs zBooleanVar.__init__cCs"|jj|j|jj|S)zSet the variable to VALUE.)rIrYrJrN)rQrr r r rZszBooleanVar.setc CsHy#|jj|jj|jSWntk rCtdYnXdS)z+Return the value of the variable as a bool.z invalid literal for getboolean()N)rIrNr[rJrxr?)rQr r r r\s# zBooleanVar.get) r5r6r7r8rPrTrZrMr\r r r r r{s  r{cCstjj|dS)zRun the main loop of Tcl.N)r:r.mainloop)nr r r r|sr|c Cs9ytjj|SWntk r4tdYnXdS)z1Convert true and false to integer values 1 and 0.z invalid literal for getboolean()N)r:r.rNrxr?)sr r r rNs rNc@seZdZdZdZddZddZdddZd d Zd d Z d dZ dddZ e Z dddZ dddZddddZdddZddZddZdd Zd!d"ZeZd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zdd1d2Zd3d4Zd5d6Zd7d8d9Z d:d;Z!d<d=Z"d>d?Z#d@dAZ$dBdCZ%dDdEZ&dFdGZ'dHdIZ(ddJdKZ)dLdMZ*dNdOZ+ddPdQZ,dRdSZ-dTdUZ.dVdWZ/dXdYZ0dZd[Z1d\d]Z2dd^d_Z3dd`daZ4e4Z5d7dbdcZ6d7dddeZ7dfdgZ8dhdiZ9djdkZ:dldmZ;d7dndoZ<dpdqZ=drdsZ>dtduZ?dvdwZ@dxdyZAdzd{ZBd7d|d}ZCd~dZDddZEddZFddZGd7ddZHddZIddZJddZKddZLddZMddZNddZOddZPddZQddZRddZSddZTddZUddZVddZWddZXddZYddZZddZ[ddZ\ddZ]ddZ^d7ddZ_ddZ`ddZaddZbddZcddZdddZeddZfddZgddZhddZiddZjdddZkdddZldddddZmdddZndddddZoddZpdddddZqddZrd7ddZsddZtddZuddZvddZwddZxeyddZzdddZ{ddZ|e|Z}ddddZ~e~ZddZdDZdjeZddZd d Zd d Zd dZddZdddZeZddZeZddZddZddZddZdgZeddZeZd d!ZeZd"d#Zdd$d%ZeZddddd&d'ZeZd(d)Zd*d+Zid,d-ZeZd.d/Zed0d1Zid2d3ZeZd4d5ZeZddd6d7Zd8d9Zd:d;Zd<d=Zdd>d?Zd@dAZdBdCZdS(EMisczRInternal class. Base class which defines methods common for interior widgets.NcCs@|jdk r<x!|jD]}|jj|qWd|_dS)zkInternal function. Delete all Tcl commands created for this widget in the Tcl interpreter.N)rUr.rV)rQrSr r r destroysz Misc.destroyc Cs=|jj|y|jj|Wntk r8YnXdS)zDInternal function. Delete the Tcl command provided in NAME.N)r.rVrUrkr?)rQrSr r r rVs  zMisc.deletecommandcCs"|jj|jjdd|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.rZtk_strictMotif)r.rNrO)rQbooleanr r r rszMisc.tk_strictMotifcCs|jjddS)zDChange the color scheme to light brown as used in Tk 3.6 and before. tk_bisqueN)r.rO)rQr r r rszMisc.tk_bisquecOs4|jjdt|tt|jdS)a Set a new color scheme for all widget elements. A single color as argument will cause that all colors of Tk widget elements are derived from this. Alternatively several keyword parameters and its associated colors can be given. The following keywords are valid: activeBackground, foreground, selectColor, activeForeground, highlightBackground, selectBackground, background, highlightColor, selectForeground, disabledForeground, insertBackground, troughColor. tk_setPaletteN)r)r.rOrrr!)rQargskwr r r rs zMisc.tk_setPalettecGs&ddl}|jdtdddS)z)Do not use. Needed in Tk 3.6 and earlier.rNz4tk_menuBar() does nothing and will be removed in 3.6 stacklevelr()warningswarnDeprecationWarning)rQrrr r r tk_menuBars  zMisc.tk_menuBarrEcCs|jjdd|dS)zWait until the variable is modified. A parameter of type IntVar, StringVar, DoubleVar or BooleanVar must be given.tkwaitr^N)r.rO)rQrSr r r wait_variableszMisc.wait_variablecCs/|dkr|}|jjdd|jdS)zQWait until a WIDGET is destroyed. If no parameter is given self is used.Nrwindow)r.rO_w)rQrr r r wait_windows zMisc.wait_windowcCs/|dkr|}|jjdd|jdS)zxWait until the visibility of a WIDGET changes (e.g. it appears). If no parameter is given self is used.NrZ visibility)r.rOr)rQrr r r wait_visibilitys zMisc.wait_visibility1cCs|jj||dS)zSet Tcl variable NAME to VALUE.N)r.setvar)rQrSrr r r rsz Misc.setvarcCs|jj|S)z"Return value of Tcl variable NAME.)r.getvar)rQrSr r r rsz Misc.getvarcCsRy|jj|SWn7tk rM}ztt|WYdd}~XnXdS)N)r.rwrxr?r)rQr~excr r r rwsz Misc.getintcCsRy|jj|SWn7tk rM}ztt|WYdd}~XnXdS)N)r.ryrxr?r)rQr~rr r r ry szMisc.getdoublec Cs9y|jj|SWntk r4tdYnXdS)zPReturn a boolean value for Tcl boolean values true and false given as parameter.z invalid literal for getboolean()N)r.rNrxr?)rQr~r r r rNs zMisc.getbooleancCs|jjd|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.focusN)r.rOr)rQr r r focus_setszMisc.focus_setcCs|jjdd|jdS)ztDirect input focus to this widget even if the application does not have the focus. Use with caution!rz-forceN)r.rOr)rQr r r focus_forceszMisc.focus_forcecCs6|jjd}|dks%| r)dS|j|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.rnoneN)r.rO _nametowidget)rQrSr r r focus_get#szMisc.focus_getcCs?|jjdd|j}|dks.| r2dS|j|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.rz -displayofrN)r.rOrr)rQrSr r r focus_displayof-szMisc.focus_displayofcCs?|jjdd|j}|dks.| r2dS|j|S)zyReturn the widget which would have the focus if top level for this widget gets the focus from the window manager.rz-lastforrN)r.rOrr)rQrSr r r focus_lastfor5szMisc.focus_lastforcCs|jjddS)zXThe widget under mouse will get automatically focus. Can not be disabled easily.tk_focusFollowsMouseN)r.rO)rQr r r r;szMisc.tk_focusFollowsMousecCs/|jjd|j}|s"dS|j|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_focusNextN)r.rOrr)rQrSr r r r?s zMisc.tk_focusNextcCs/|jjd|j}|s"dS|j|S)zHReturn previous widget in the focus order. See tk_focusNext for details. tk_focusPrevN)r.rOrr)rQrSr r r rKszMisc.tk_focusPrevcslsjjd|nLfdd}j|_j|jjd|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.aftercs<zWdyjWntk r6YnXXdS)N)rVrxr )rfuncrSrQr r callit[s  zMisc.after..callitN)r.rOr5 _register)rQmsrrrr )rrrSrQr rPs  z Misc.aftercGs|jd||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)rQrrr r r after_idlefszMisc.after_idlec Csny?|jjdd|}|jj|d}|j|Wntk rSYnX|jjdd|dS)zCancel scheduling of function identified with ID. Identifier returned by after or after_idle must be given as first parameter.rrFrcancelN)r.rOr*rVrx)rQradataZscriptr r r after_cancelms zMisc.after_cancelrcCs!|jjd|j|dS)zRing a display's bell.bellN)r)r.rO _displayof)rQ displayofr r r r{sz Misc.bellc Ksd|krb|jdkrby+d|d<|jjd|j|SWntk ra|d=YnX|jjd|j|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) rx11 UTF8_STRING clipboardr\)rr\)rr\)_windowingsystemr.rO_optionsrx)rQrr r r clipboard_gets !  zMisc.clipboard_getcKs:d|kr|j|d<|jjd|j|dS)zClear the data in the Tk clipboard. A widget specified for the optional displayof keyword argument specifies the target display.rrclearN)rr)rr.rOr)rQrr r r clipboard_clears zMisc.clipboard_clearcKsDd|kr|j|d<|jjd|j|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.rrrdz--N)rrd)rr.rOr)rQstringrr r r clipboard_appends  zMisc.clipboard_appendcCs2|jjdd|j}|s%dS|j|S)zOReturn widget which has currently the grab in this application or None.grabcurrentN)r.rOrr)rQrSr r r grab_currentszMisc.grab_currentcCs|jjdd|jdS)z.Release grab for this widget if currently set.rreleaseN)r.rOr)rQr r r grab_releaseszMisc.grab_releasecCs|jjdd|jdS)zwSet grab for this widget. A grab directs all events to this and descendant widgets in the application.rrZN)r.rOr)rQr r r grab_setsz Misc.grab_setcCs |jjddd|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.rrZz-globalN)r.rOr)rQr r r grab_set_globalszMisc.grab_set_globalcCs1|jjdd|j}|dkr-d}|S)zYReturn None, "local" or "global" if this widget has no, a local or a global grab.rstatusrN)r.rOr)rQrr r r grab_statuss zMisc.grab_statuscCs |jjdd|||dS)zSet a VALUE (second parameter) for an option PATTERN (first parameter). An optional third parameter gives the numeric priority (defaults to 80).optionaddN)r.rO)rQpatternrpriorityr r r option_addszMisc.option_addcCs|jjdddS)zPClear the option database. It will be reloaded if option_add is called.rrN)r.rO)rQr r r option_clearszMisc.option_clearcCs|jjdd|j||S)zReturn the value for an option NAME for this widget with CLASSNAME. Values with higher priority override lower values.rr\)r.rOr)rQrS classNamer r r option_getszMisc.option_getcCs|jjdd||dS)zvRead file FILENAME into the option database. An optional second parameter gives the numeric priority.rZreadfileN)r.rO)rQZfileNamerr r r option_readfileszMisc.option_readfilecKs:d|kr|j|d<|jjd|j|dS)zClear the current X selection.r selectionrN)rr)rr.rOr)rQrr r r selection_clears zMisc.selection_clearc Ksd|kr|j|dr.rOr)rQr r r winfo_idWsz Misc.winfo_idcCs/d|j|}|jj|jj|S)z9Return the name of all Tcl interpreters for this display.rinterps)rr)rr.r*rO)rQrrr r r winfo_interpsZszMisc.winfo_interpscCs%|jj|jjdd|jS)z%Return true if this widget is mapped.rZismapped)r.rwrOr)rQr r r winfo_ismapped^s zMisc.winfo_ismappedcCs|jjdd|jS)z/Return the window manager name for this widget.rmanager)r.rOr)rQr r r winfo_managerbszMisc.winfo_managercCs|jjdd|jS)zReturn the name of this widget.rrS)r.rOr)rQr r r winfo_nameeszMisc.winfo_namecCs|jjdd|jS)z-Return the name of the parent of this widget.rparent)r.rOr)rQr r r winfo_parenthszMisc.winfo_parentcCs*d|j||f}|jj|S)z.Return the pathname of the widget given by ID.rpathname)rr)rr.rO)rQrarrr r r winfo_pathnamekszMisc.winfo_pathnamecCs(|jj|jjdd|j|S)z'Rounded integer value of winfo_fpixels.rZpixels)r.rwrOr)rQrr r r winfo_pixelsps zMisc.winfo_pixelscCs%|jj|jjdd|jS)z:Return the x coordinate of the pointer on the root window.rZpointerx)r.rwrOr)rQr r r winfo_pointerxts zMisc.winfo_pointerxcCs"|j|jjdd|jS)zHReturn a tuple of x and y coordinates of the pointer on the root window.rZ pointerxy)_getintsr.rOr)rQr r r winfo_pointerxyxszMisc.winfo_pointerxycCs%|jj|jjdd|jS)z:Return the y coordinate of the pointer on the root window.rZpointery)r.rwrOr)rQr r r winfo_pointery|s zMisc.winfo_pointerycCs%|jj|jjdd|jS)z'Return requested height of this widget.rZ reqheight)r.rwrOr)rQr r r winfo_reqheights zMisc.winfo_reqheightcCs%|jj|jjdd|jS)z&Return requested width of this widget.rZreqwidth)r.rwrOr)rQr r r winfo_reqwidths zMisc.winfo_reqwidthcCs%|j|jjdd|j|S)zUReturn tuple of decimal values for red, green, blue for COLOR in this widget.rZrgb)rr.rOr)rQZcolorr r r winfo_rgbszMisc.winfo_rgbcCs%|jj|jjdd|jS)zSReturn x coordinate of upper left corner of this widget on the root window.rZrootx)r.rwrOr)rQr r r winfo_rootxs zMisc.winfo_rootxcCs%|jj|jjdd|jS)zSReturn y coordinate of upper left corner of this widget on the root window.rZrooty)r.rwrOr)rQr r r winfo_rootys zMisc.winfo_rootycCs|jjdd|jS)z&Return the screen name of this widget.rscreen)r.rOr)rQr r r winfo_screenszMisc.winfo_screencCs%|jj|jjdd|jS)zTReturn the number of the cells in the colormap of the screen of this widget.rZ screencells)r.rwrOr)rQr r r winfo_screencellss zMisc.winfo_screencellscCs%|jj|jjdd|jS)z\Return the number of bits per pixel of the root window of the screen of this widget.rZ screendepth)r.rwrOr)rQr r r winfo_screendepths zMisc.winfo_screendepthcCs%|jj|jjdd|jS)zXReturn the number of pixels of the height of the screen of this widget in pixel.rZ screenheight)r.rwrOr)rQr r r winfo_screenheights zMisc.winfo_screenheightcCs%|jj|jjdd|jS)zUReturn the number of pixels of the height of the screen of this widget in mm.rZscreenmmheight)r.rwrOr)rQr r r winfo_screenmmheights zMisc.winfo_screenmmheightcCs%|jj|jjdd|jS)zTReturn the number of pixels of the width of the screen of this widget in mm.rZ screenmmwidth)r.rwrOr)rQr r r winfo_screenmmwidths zMisc.winfo_screenmmwidthcCs|jjdd|jS)zReturn one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the default colormodel of this screen.rZ screenvisual)r.rOr)rQr r r winfo_screenvisualszMisc.winfo_screenvisualcCs%|jj|jjdd|jS)zWReturn the number of pixels of the width of the screen of this widget in pixel.rZ screenwidth)r.rwrOr)rQr r r winfo_screenwidths zMisc.winfo_screenwidthcCs|jjdd|jS)zxReturn information of the X-Server of the screen of this widget in the form "XmajorRminor vendor vendorVersion".rZserver)r.rOr)rQr r r winfo_serverszMisc.winfo_servercCs"|j|jjdd|jS)z*Return the toplevel widget of this widget.rtoplevel)rr.rOr)rQr r r winfo_toplevelszMisc.winfo_toplevelcCs%|jj|jjdd|jS)zBReturn true if the widget and all its higher ancestors are mapped.rZviewable)r.rwrOr)rQr r r winfo_viewables zMisc.winfo_viewablecCs|jjdd|jS)zReturn one of the strings directcolor, grayscale, pseudocolor, staticcolor, staticgray, or truecolor for the colormodel of this widget.rvisual)r.rOr)rQr r r winfo_visualszMisc.winfo_visualcCs|jjdd|jS)z7Return the X identifier for the visual for this widget.rZvisualid)r.rOr)rQr r r winfo_visualidszMisc.winfo_visualidcsqjjjjddj|r*dp-d}t|trZjj|g}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=1 is given also the X identifier.rZvisualsavailable includeidsNcsg|]}j|qSr )_Misc__winfo_parseitem)rorp)rQr r rqs z/Misc.winfo_visualsavailable..)r.splitrOrrr)rQrrr )rQr winfo_visualsavailables  zMisc.winfo_visualsavailablecCs.|ddtt|j|ddS)zInternal function.Nr)rr_Misc__winfo_getint)rQr0r r r Z__winfo_parseitemszMisc.__winfo_parseitemcCs t|dS)zInternal function.r)r>)rQrpr r r Z__winfo_getintszMisc.__winfo_getintcCs%|jj|jjdd|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.rZ vrootheight)r.rwrOr)rQr r r winfo_vrootheights zMisc.winfo_vrootheightcCs%|jj|jjdd|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 vrootwidth)r.rwrOr)rQr r r winfo_vrootwidths zMisc.winfo_vrootwidthcCs%|jj|jjdd|jS)ziReturn the x offset of the virtual root relative to the root window of the screen of this widget.rZvrootx)r.rwrOr)rQr r r winfo_vrootxs zMisc.winfo_vrootxcCs%|jj|jjdd|jS)ziReturn the y offset of the virtual root relative to the root window of the screen of this widget.rZvrooty)r.rwrOr)rQr r r winfo_vrootys zMisc.winfo_vrootycCs%|jj|jjdd|jS)z Return the width of this widget.rwidth)r.rwrOr)rQr r r winfo_widths zMisc.winfo_widthcCs%|jj|jjdd|jS)zVReturn the x coordinate of the upper left corner of this widget in the parent.rrp)r.rwrOr)rQr r r winfo_xs z Misc.winfo_xcCs%|jj|jjdd|jS)zVReturn the y coordinate of the upper left corner of this widget in the parent.ry)r.rwrOr)rQr r r winfo_ys z Misc.winfo_ycCs|jjddS)zEEnter event loop until all pending events have been processed by Tcl.rN)r.rO)rQr r r rsz Misc.updatecCs|jjdddS)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.rZ idletasksN)r.rO)rQr r r update_idletasks szMisc.update_idletaskscCsK|dkr.|jj|jjd|jS|jjd|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).Nbindtags)r.r*rOr)rQZtagListr r r r&s  z Misc.bindtagsrcCst|tr,|jj|||fn|r|j||j|}d|rYdp\d||jf}|jj|||f|S|r|jj||fS|jj|jj|SdS)zInternal function.z"%sif {"[%s %s]" == "break"} break +rDN)rrr.rOr _substitute_subst_format_strr*)rQwhatsequencerr needcleanupfuncidrr r r _binds z Misc._bindcCs|jd|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 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.bind)r.r)rQr+rrr r r r/,s'z Misc.bindcCs3|jjd|j|d|r/|j|dS)zWUnbind for this widget for event SEQUENCE the function identified with FUNCID.r/rDN)r.rOrrV)rQr+r-r r r unbindTsz Misc.unbindcCs|jd|||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.r/allr)r/r1)r.)rQr+rrr r r bind_allZsz Misc.bind_allcCs|jjdd|ddS)z8Unbind for all widgets for event SEQUENCE all functions.r/r1rDN)r.rO)rQr+r r r unbind_all`szMisc.unbind_allcCs|jd|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.r/r)r.)rQrr+rrr r r bind_classcs zMisc.bind_classcCs|jjd||ddS)zWUnbind for all widgets with bindtag CLASSNAME for event SEQUENCE all functions.r/rDN)r.rO)rQrr+r r r unbind_classmszMisc.unbind_classcCs|jj|dS)zCall the mainloop of Tk.N)r.r|)rQr}r r r r|qsz Misc.mainloopcCs|jjdS)z8Quit the Tcl interpreter. All widgets will be destroyed.N)r.quit)rQr r r r6tsz Misc.quitcCs/|r+tt|jj|jj|SdS)zInternal function.N)rrr.rwr*)rQrr r r rwsz Misc._getintscCs/|r+tt|jj|jj|SdS)zInternal function.N)rrr.ryr*)rQrr r r _getdoubles{szMisc._getdoublescCs|r|jj|SdS)zInternal function.N)r.rN)rQrr r r _getbooleanszMisc._getbooleancCs-|rd|fS|dkr)d|jfSfS)zInternal function.z -displayofN)r)rQrr r r rs    zMisc._displayofc CsPy|jjSWn8tk rK|jjdd}|j_|SYnXdS)zInternal function.r.ZwindowingsystemN)rHZ_windowingsystem_cachedrr.rO)rQZwsr r r rs  "zMisc._windowingsystemcCs2|rt||f}n t|}f}x|jD]\}}|dk r:|ddkrr|dd}t|r|j|}nt|ttfrg}xh|D]Q}t|tr|jt |qt|t r|jt |qPqWdj |}|d||f}q:W|S)zInternal function.Nr_rr)r:) r'r!callablerrrrr>rdrrr)rQr"rrr%r&Znvrr r r rs*    z Misc._optionscCsjt|jd}|}|dsA|j}|dd}x"|D]}|sUP|j|}qHW|S)zPReturn the Tkinter instance of a widget identified by its Tcl name NAME..rrN)rrrHr)rQrSwr}r r r nametowidgets   zMisc.nametowidgetcCst|||j}tt|}y |j}Wntk rHYnXy||j}Wntk rnYnX|jj|||r|j dkrg|_ |j 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) r_r`rKrarbrr5r.rcrUrd)rQrsubstr,rgrSr r r rs     zMisc._registercCs#|}x|jr|j}q W|S)zInternal function.)rR)rQr=r r r rHs z Misc._root%#%b%f%h%k%s%t%w%x%y%A%E%K%N%W%T%X%Y%Drc$s"t|t|jkr|S|jj}|jjfdd}|\}}}}}} } } } } }}}}}}}}}t}||_|||_y|||_Wnt k rYnX|||_ |||_ || |_ || |_ || |_|| |_|| |_||_y|||_Wnt k rpYnX||_|||_||_y|j||_Wntk r||_YnX|||_|||_y||_Wn!tt fk rd|_YnX|fS)zInternal function.c s1y|SWnttfk r,|SYnXdS)z?Tk changed behavior in 8.4.2, returning "??" rather more often.N)r?rx)r~)rwr r getint_eventsz&Misc._substitute..getint_eventr)r _subst_formatr.rNrwr4serialnumrrxrZkeycodestatetimer rpr#charZ send_eventZkeysymZ keysym_numrrwidgetrZx_rootZy_rootdeltar?)rQrrNrSZnsignbrghr%r~r0r=rpr#AEKNWTXYDer )rwr r(sN  ?       zMisc._substitutecCs8tj\}}}|j}|j|||dS)zInternal function.N)sysexc_inforHreport_callback_exception)rQrvaltbrootr r r _report_exceptions zMisc._report_exceptioncGs|i}xo|jj|jj|D]O}|jj|}|dddf|dd||ddd.rr)r.r*rOr)rQr )r*r keysBs z Misc.keyscCs|jS)z+Return the window path name of this widget.)r)rQr r r rXGsz Misc.__str__cCs d|jj|jj|jfS)Nz<%s.%s object %s>)rrr6r7r)rQr r r __repr__Ksz Misc.__repr___noarg_cCsQ|tjkr1|j|jjdd|jS|jjdd|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 propagateN)rrwr8r.rOr)rQflagr r r pack_propagateQszMisc.pack_propagatecs8fddjjjjddjDS)zHReturn a list of all slaves of this widget in its packing order.csg|]}j|qSr )r)rorp)rQr r rqas z$Misc.pack_slaves..rxslaves)r.r*rOr)rQr )rQr pack_slaves^s zMisc.pack_slavescs8fddjjjjddjDS)zHReturn a list of all slaves of this widget in its packing order.csg|]}j|qSr )r)rorp)rQr r rqis z%Misc.place_slaves..placer|)r.r*rOr)rQr )rQr place_slavesfs  zMisc.place_slavescCs |jjdd|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.gridanchorN)r.rOr)rQrr r r grid_anchornszMisc.grid_anchorcCsdd|jf}|dk r:|dk r:|||f}|dk rb|dk rb|||f}|j|jj|pdS)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)rrr.rO)rQcolumnrowZcol2Zrow2rr r r grid_bboxus zMisc.grid_bboxc Cs}t|ttjfryyFt|}|s1dSd|krM|jj|S|jj|SWnttfk rxYnX|S)Nr<) rr_tkinterZTcl_Objr.ryrwr?rx)rQrZsvaluer r r _gridconvvalues  zMisc._gridconvvaluecCst|trh| rh|dddkr<|dd}|dddkr\d|}|f}n|j||}|st|j|jjd||j|d|jS|jjd||j|f|}t|dkr|j|SdS) zInternal function.rNr9r)rr/r:r:) rrrr3r.rOrrr)rQrindexr"roptionsrr r r _grid_configures"     zMisc._grid_configurecKs|jd|||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).columnconfigure)r)rQrr"rr r r grid_columnconfigureszMisc.grid_columnconfigurecCs.|j|jjdd|j||p-dS)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.rlocationN)rr.rOr)rQrpr#r r r grid_locations zMisc.grid_locationcCsQ|tjkr1|j|jjdd|jS|jjdd|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. rryN)rrwr8r.rOr)rQrzr r r grid_propagateszMisc.grid_propagatecKs|jd|||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). rowconfigure)r)rQrr"rr r r grid_rowconfigureszMisc.grid_rowconfigurecCs(|j|jjdd|jp'dS)z|d|f}fddjjjjddjf|DS)zHReturn a list of all slaves of this widget in its packing order.Nz-rowz-columncsg|]}j|qSr )r)rorp)rQr r rqs z$Misc.grid_slaves..rr|)r.r*rOr)rQrrrr )rQr grid_slavess  zMisc.grid_slavescGs'dd|f|}|jj|dS)zBind a virtual event VIRTUAL (of the form <>) to an event SEQUENCE such that the virtual event is triggered whenever SEQUENCE occurs.eventrN)r.rO)rQvirtual sequencesrr r r event_addszMisc.event_addcGs'dd|f|}|jj|dS)z-Unbind a virtual event VIRTUAL from SEQUENCE.rdeleteN)r.rO)rQrrrr r r event_deleteszMisc.event_deletecKs`dd|j|f}x4|jD]&\}}|d|t|f}q"W|jj|dS)zGenerate an event SEQUENCE. Additional keyword arguments specify parameter of the event (e.g. x, y, rootx, rooty).rZgeneratez-%sN)rr!rr.rO)rQr+rrr%r&r r r event_generateszMisc.event_generatecCs"|jj|jjdd|S)zuReturn a list of all virtual events or the information about the SEQUENCE bound to the virtual event VIRTUAL.rrF)r.r*rO)rQrr r r event_infos zMisc.event_infocCs|jj|jjddS)z*Return a list of all existing image names.imagenames)r.r*rO)rQr r r image_namesszMisc.image_namescCs|jj|jjddS)z?Return a list of all available image types (e.g. photo bitmap).rtypes)r.r*rO)rQr r r image_typesszMisc.image_types)r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrR)r5r6r7r8rUrrVrrrrrZwaitvarrrrrrwryrNrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrliftrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r r r r rrrrrrrrrrrrrrr!r"r$rr%r&r.r/r0r2r3r4r5r|r6rr7r8rpropertyrrr>rrregisterrHrTrr)r(rnrorprqrrconfigrs __getitem__rtrurXrvrwr{ryr}r|rrrrrrrrrrrrrrrrrrrrrrr r r r rsR                                                                            (           9                      rc@s.eZdZdZddZddZdS)r_zwInternal 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)rr?rZ)rQrr?rZr r r rT s  zCallWrapper.__init__c GsYy)|jr|j|}|j|SWn)tk r@Yn|jjYnXdS)z3Apply first function SUBST to arguments, than FUNC.N)r?rr@rZrn)rQrr r r r`s  zCallWrapper.__call__N)r5r6r7r8rTr`r r r r r_ s  r_c@s:eZdZdZddZddZddZdS) XViewzXMix-in class for querying and changing the horizontal position of a widget's window.cGs2|jj|jd|}|s.|j|SdS)z5Query and change the horizontal position of the view.xviewN)r.rOrr7)rQrrr r r r!sz XView.xviewcCs |jj|jdd|dS)zsAdjusts the view in the window so that FRACTION of the total width of the canvas is off-screen to the left.rmovetoN)r.rOr)rQfractionr r r xview_moveto'szXView.xview_movetocCs#|jj|jdd||dS)z\Shift the x-view according to NUMBER which is measured in "units" or "pages" (WHAT).rscrollN)r.rOr)rQrr*r r r xview_scroll,szXView.xview_scrollN)r5r6r7r8rrrr r r r rs   rc@s:eZdZdZddZddZddZdS) YViewzVMix-in class for querying and changing the vertical position of a widget's window.cGs2|jj|jd|}|s.|j|SdS)z3Query and change the vertical position of the view.yviewN)r.rOrr7)rQrrr r r r6sz YView.yviewcCs |jj|jdd|dS)zsAdjusts the view in the window so that FRACTION of the total height of the canvas is off-screen to the top.rrN)r.rOr)rQrr r r yview_moveto<szYView.yview_movetocCs#|jj|jdd||dS)z\Shift the y-view according to NUMBER which is measured in "units" or "pages" (WHAT).rrN)r.rOr)rQrr*r r r yview_scrollAszYView.yview_scrollN)r5r6r7r8rrrr r r r r2s   rc@seZdZdZddddddZeZddZeZdddZeZ d d Z e Z dd d Z e Z d dZeZdddZeZddZeZddZeZdddZeZddddddZeZdddZeZddddZeZddZeZddd Z e Z!dd!d"Z"e"Z#d#d$d%Z$e$Z%ddd&d'Z&e&Z'dd(d)Z(e(Z)d*d+Z*e*Z+ddd,d-Z,e,Z-ddd.d/Z.e.Z/dd0d1Z0e0Z1dd2d3Z2e2Z3ddd4d5Z4e4Z5ddd6d7Z6e6Z7dd8d9Z8e8Z9dd:d;Z:e:Z;dd<d=Z<e<Z=dd>d?Z>e>Z?d@dAZ@e@ZAdS)BWmzAProvides functions for the communication with the window manager.Nc Cs.|j|jjdd|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.wmaspect)rr.rOr)rQZminNumerZminDenomZmaxNumerZmaxDenomr r r wm_aspectJsz Wm.wm_aspectcGs&dd|jf|}|jj|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)rr.rO)rQrr r r wm_attributesVszWm.wm_attributescCs|jjdd|j|S)zVStore NAME in WM_CLIENT_MACHINE property of this widget. Return current value.rclient)r.rOr)rQrSr r r wm_clientlsz Wm.wm_clientcs}t|dkr|f}ddjf|}|rJjj|n/fddjjjj|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|]}j|qSr )r)rorp)rQr r rq{s z)Wm.wm_colormapwindows..N)rrr.rOr*)rQZwlistrr )rQr wm_colormapwindowsqs zWm.wm_colormapwindowscCs|jjdd|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.rr)r.rOr)rQrr r r wm_command~sz Wm.wm_commandcCs|jjdd|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 deiconify)r.rOr)rQr r r wm_deiconifyszWm.wm_deiconifycCs|jjdd|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 focusmodel)r.rOr)rQZmodelr r r wm_focusmodelszWm.wm_focusmodelcCs|jjdd|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.rforgetN)r.rO)rQrr r r wm_forgetsz Wm.wm_forgetcCs|jjdd|jS)zAReturn identifier for decorative frame of this widget if present.rframe)r.rOr)rQr r r wm_framesz Wm.wm_framecCs|jjdd|j|S)ziSet geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return current value if None is given.rr)r.rOr)rQZ newGeometryr r r wm_geometryszWm.wm_geometryc Cs.|j|jjdd|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.rr)rr.rOr)rQZ baseWidthZ baseHeightZwidthIncZ heightIncr r r wm_grids z Wm.wm_gridcCs|jjdd|j|S)z~Set the group leader widgets for related widgets to PATHNAME. Return the group leader of this widget if None is given.rgroup)r.rOr)rQpathNamer r r wm_groupsz Wm.wm_groupcCsE|r%|jjdd|jd|S|jjdd|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 iconbitmapz-defaultN)r.rOr)rQbitmapdefaultr r r wm_iconbitmaps zWm.wm_iconbitmapcCs|jjdd|jS)zDisplay widget as icon.riconify)r.rOr)rQr r r wm_iconifysz Wm.wm_iconifycCs|jjdd|j|S)zVSet mask for the icon bitmap of this widget. Return the mask if None is given.riconmask)r.rOr)rQrr r r wm_iconmaskszWm.wm_iconmaskcCs|jjdd|j|S)zSSet the name of the icon for this widget. Return the name if None is given.riconname)r.rOr)rQZnewNamer r r wm_iconnameszWm.wm_iconnameFcGsH|r(|jjdd|jd|n|jjdd|j|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 iconphotoz-defaultN)r.rOr)rQrrr r r wm_iconphotos"zWm.wm_iconphotocCs(|j|jjdd|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 iconposition)rr.rOr)rQrpr#r r r wm_iconpositionszWm.wm_iconpositioncCs|jjdd|j|S)zgSet widget PATHNAME to be displayed instead of icon. Return the current value if None is given.r iconwindow)r.rOr)rQrr r r wm_iconwindowszWm.wm_iconwindowcCs|jjdd|dS)zThe widget specified will become a stand alone top-level window. The window will be decorated with the window managers title bar, etc.rmanageN)r.rO)rQrZr r r wm_managesz Wm.wm_managecCs(|j|jjdd|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.rmaxsize)rr.rOr)rQr rr r r wm_maxsizesz Wm.wm_maxsizecCs(|j|jjdd|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.rminsize)rr.rOr)rQr rr r r wm_minsizesz Wm.wm_minsizecCs%|j|jjdd|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)r8r.rOr)rQrr r r wm_overrideredirectszWm.wm_overrideredirectcCs|jjdd|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 positionfrom)r.rOr)rQwhor r r wm_positionfrom szWm.wm_positionfromcCsCt|r|j|}n|}|jjdd|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)r;rr.rOr)rQrSrrr r r wm_protocols   zWm.wm_protocolcCs|jjdd|j||S)zyInstruct the window manager whether this width can be resized in WIDTH or HEIGHT. Both values are boolean values.r resizable)r.rOr)rQr rr r r wm_resizableszWm.wm_resizablecCs|jjdd|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".rsizefrom)r.rOr)rQrr r r wm_sizefrom!szWm.wm_sizefromcCs|jjdd|j|S)zQuery or set the state of this widget as one of normal, icon, iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).rrW)r.rOr)rQZnewstater r r wm_state'sz Wm.wm_statecCs|jjdd|j|S)zSet the title of this widget.rtitle)r.rOr)rQrr r r wm_title,sz Wm.wm_titlecCs|jjdd|j|S)z_Instruct the window manager that this widget is transient with regard to widget MASTER.r transient)r.rOr)rQrRr r r wm_transient0szWm.wm_transientcCs|jjdd|jS)zWithdraw this widget from the screen such that it is unmapped and forgotten by the window manager. Re-draw it with wm_deiconify.rwithdraw)r.rOr)rQr r r wm_withdraw5szWm.wm_withdraw)Br5r6r7r8rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrWrrrrrrr r r r rGs           rc@seZdZdZdZddddddddZdd Zd d Zd d ZddZ ddZ ddZ dS)TkzzToplevel widget of Tk which represents mostly the main window of an application. It has an associated Tcl interpreter.r<Nrrc Csd|_i|_d|_d|_|dkrddl}|jjtjd}|jj |\}}|dkr||}d} t j |||| t ||||_|r|j tjjs|j||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.Nr.py.pyc)rr)rRr _tkloadedr.ospathbasenamerhargvsplitextrcreate wantobjects_loadtkflagsignore_environment readprofile) rQ screenNamebaseNameruseTksyncZuserext interactiver r r rT@s         '  z Tk.__init__cCs$|js |jj|jdS)N)rr.loadtkr)rQr r r rZs  z Tk.loadtkcCs-d|_|jjd}|tjkrCtdtj|ft|jjd}|tjkrtdtj|ftdkrtdtt|j dkrg|_ |jj dt |jj d t |j j d|j j d trt r|a|jd |jdS) Nr tk_versionz4tk.h version (%s) doesn't match libtk.a version (%s) tcl_versionz6tcl.h version (%s) doesn't match libtcl.a version (%s)g@z)Tk 4.0 or higher is required; found Tk %sZtkerrorexitWM_DELETE_WINDOW)rr.rr TK_VERSIONr+r TCL_VERSION TkVersionrUrcr=rBrdr9r:rr)rQr r r r r r^s*    z Tk._loadtkcCsix't|jjD]}|jqW|jjd|jtj|tret |kreda dS)zhDestroy this and all descendants widgets. This will end the application of this Tcl interpreter.rN) rrvaluesrr.rOrrr9r:)rQr#r r r rzs  z Tk.destroyc CsUddl}d|jkr+|jd}n |j}|jj|d|}|jj|d|}|jj|d|}|jj|d|}d|i} td| |jj|r|jjd||jj|rtt |j | |jj|r&|jjd||jj|rQtt |j | 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.pyrQzfrom tkinter import *source) renvironcurdirrrexecisfiler.rOopenread) rQrrrhomeZ class_tclZclass_pyZbase_tclZbase_pydirr r r rs$    zTk.readprofilecCsQddl}tddtj|t_|t_|t_|j|||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 callbackfile) tracebackr rhstderr last_type last_valuelast_tracebackprint_exception)rQrrkrlrr r r rjs     zTk.report_callback_exceptioncCst|j|S)z3Delegate attribute access to the interpreter object)getattrr.)rQattrr r r __getattr__szTk.__getattr__) r5r6r7r8rrTrrrrrjr$r r r r r<s      rcCst||||S)N)r)rrrrr r r Tclsr%c@sqeZdZdZiddZeZZZddZeZ ddZ e Z e j ZZ e jZZdS) PackzQGeometry manager Pack. Base class to use the methods pack_* in every widget.cKs0|jjdd|jf|j||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. rxrrN)r.rOrr)rQr"rr r r pack_configures zPack.pack_configurecCs|jjdd|jdS)z:Unmap this widget and do not use it for the packing order.rxrN)r.rOr)rQr r r pack_forgetszPack.pack_forgetcCsNt|j|jjdd|j}d|krJ|j|d|d<|S)zEReturn information about the packing options for this widget.rxrFin)r3r.rOrr>)rQdr r r pack_infos' zPack.pack_infoN)r5r6r7r8r'rxrrrr(rr+rFrr{ryr}r|r r r r r&s    r&c@sdeZdZdZiddZeZZZddZeZ ddZ e Z e j ZZ dS) PlacezSGeometry manager Place. Base class to use the methods place_* in every widget.cKs0|jjdd|jf|j||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 r~rrN)r.rOrr)rQr"rr r r place_configures zPlace.place_configurecCs|jjdd|jdS)zUnmap this widget.r~rN)r.rOr)rQr r r place_forgetszPlace.place_forgetcCsNt|j|jjdd|j}d|krJ|j|d|d<|S)zEReturn information about the placing options for this widget.r~rFr))r3r.rOrr>)rQr*r r r place_infos' zPlace.place_infoN)r5r6r7r8r-r~rrrr.rr/rFrrr|r r r r r,s   r,c@seZdZdZiddZeZZZej Z Z ej Z Z ddZ e ZddZdd ZeZejZZejZZejZZejZZejZZd S) GridzQGeometry manager Grid. Base class to use the methods grid_* in every widget.cKs0|jjdd|jf|j||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 rrrN)r.rOrr)rQr"rr r r grid_configures zGrid.grid_configurecCs|jjdd|jdS)zUnmap this widget.rrN)r.rOr)rQr r r grid_forget&szGrid.grid_forgetcCs|jjdd|jdS)z0Unmap this widget but remember the grid options.rrkN)r.rOr)rQr r r grid_remove*szGrid.grid_removecCsNt|j|jjdd|j}d|krJ|j|d|d<|S)zSReturn information about the options for positioning this widget in a grid.rrFr))r3r.rOrr>)rQr*r r r grid_info-s' zGrid.grid_infoN)r5r6r7r8r1rrrrrrrrrr2rr3r4rFrrrryrrrrrr|r r r r r0 s          r0c@sReZdZdZddZiifddZddZfdd Zd S) BaseWidgetzInternal class.cCstr!|s!tstat}||_|j|_d}d|krY|d}|d=|sqtt|}||_|jdkrd||_n|jd||_i|_ |j|jj kr|jj |jj ||jj |j.) r' widgetNamer5r6rUr!r.rOrrrr) rQrRr7r"rextraclassesr%r&r r r rTVs    !zBaseWidget.__init__cCsvx't|jjD]}|jqW|jjd|j|j|jjkre|jj|j=t j|dS)z)Destroy this and all descendants widgets.rN) rrrrr.rOrrJrRr)rQr#r r r rfs zBaseWidget.destroycCs|jj|j|f|S)N)r.rOr)rQrSrr r r _domszBaseWidget._doN)r5r6r7r8r6rTrr:r r r r r5;s   r5c@seZdZdZdS)WidgetzxInternal class. Base class for a widget which can be positioned with the geometry managers Pack, Place or Grid.N)r5r6r7r8r r r r r;qs r;c@s(eZdZdZdiddZdS)Toplevelz"Toplevel widget, e.g. for dialogs.Nc Ks|rt||f}f}x{dddddgD]d}||kr4||}|d dkrwd|d d }n d|}|||f}||=q4Wtj||d |i||j}|j|j|j|j|jd |jd S)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.rclass_rrZcolormaprr9r)Nrr r:r:)r'r5rTrHrrrr) rQrRr"rr8Zwmkeyrkoptrmr r r rTzs"      zToplevel.__init__)r5r6r7r8rTr r r r r<xs r<c@s@eZdZdZdiddZddZddZdS) ButtonzButton widget.NcKstj||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 ZbuttonN)r;rT)rQrRr"rr r r rTszButton.__init__cCs|jj|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. flashN)r.rOr)rQr r r r@s z Button.flashcCs|jj|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. invoke)r.rOr)rQr r r rAsz Button.invoke)r5r6r7r8rTr@rAr r r r r?s  r?c@seZdZdZdiddZddZddZd d Zd d Zddd dZ ddZ ddZ ddZ ddZ dddZdddddZdddZdddZdd 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#dddCdDZ$dEdFZ%dGdHZ&dIdJZ'dKdLZ(dMdNZ)dOdPZ*dQdRZ+dSdTZ,dUdVZ-ddWdXZ.e.Z/dYdZZ0e0Z1d[d\Z2id]d^Z3d_d`Z4e4Z5Z6dadbZ7dcddZ8dedfdgZ9dhdiZ:djdkZ;dldmZ<dndoZ=dpdqZ>drdsZ?dS)tCanvasz?Canvas widget to display graphical elements like lines or text.NcKstj||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.ZcanvasN)r;rT)rQrRr"rr r r rTs zCanvas.__init__cGs!|jj|jdf|dS)zInternal function.addtagN)r.rOr)rQrr r r rCsz Canvas.addtagcCs|j|d|dS)z*Add tag NEWTAG to all items above TAGORID.aboveN)rC)rQnewtagtagOrIdr r r addtag_aboveszCanvas.addtag_abovecCs|j|ddS)zAdd tag NEWTAG to all items.r1N)rC)rQrEr r r addtag_allszCanvas.addtag_allcCs|j|d|dS)z*Add tag NEWTAG to all items below TAGORID.belowN)rC)rQrErFr r r addtag_belowszCanvas.addtag_belowcCs |j|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.closestN)rC)rQrErpr#halostartr r r addtag_closestszCanvas.addtag_closestcCs |j|d||||dS)zLAdd tag NEWTAG to all items in the rectangle defined by X1,Y1,X2,Y2.enclosedN)rC)rQrEx1y1x2y2r r r addtag_enclosedszCanvas.addtag_enclosedcCs |j|d||||dS)zWAdd tag NEWTAG to all items which overlap the rectangle defined by X1,Y1,X2,Y2. overlappingN)rC)rQrErPrQrRrSr r r addtag_overlappingszCanvas.addtag_overlappingcCs|j|d|dS)z)Add tag NEWTAG to all items with TAGORID.withtagN)rC)rQrErFr r r addtag_withtagszCanvas.addtag_withtagcGs,|j|jj|jdf|p+dS)z|Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle which encloses all items with tags specified as arguments.rN)rr.rOr)rQrr r r rsz Canvas.bboxcCs6|jj|jd||d|r2|j|dS)zbUnbind for all items with TAGORID for event SEQUENCE the function identified with FUNCID.r/rDN)r.rOrrV)rQrFr+r-r r r tag_unbindszCanvas.tag_unbindcCs"|j|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.r/)r.r)rQrFr+rrr r r tag_bindszCanvas.tag_bindcCs(|jj|jj|jd||S)zrReturn the canvas x coordinate of pixel position SCREENX rounded to nearest multiple of GRIDSPACING units.canvasx)r.ryrOr)rQZscreenx gridspacingr r r r[szCanvas.canvasxcCs(|jj|jj|jd||S)zrReturn the canvas y coordinate of pixel position SCREENY rounded to nearest multiple of GRIDSPACING units.canvasy)r.ryrOr)rQZscreenyr\r r r r] szCanvas.canvasycs<fddjjjjjdf|DS)z8Return a list of coordinates for the item given in ARGS.cs"g|]}jj|qSr )r.ry)rorp)rQr r rq s z!Canvas.coords..coords)r.r*rOr)rQrr )rQr r^ s z Canvas.coordsc Cs|t|}|d}t|ttfr>|dd}ni}|jj|jj|jd|||j||S)zInternal function.rNrr:r:) rrrrr.rwrOrr)rQitemTyperrr"r r r _create s   zCanvas._createcOs|jd||S)z6Create arc shaped region with coordinates x1,y1,x2,y2.Zarc)r`)rQrrr r r create_arc szCanvas.create_arccOs|jd||S)z%Create bitmap with coordinates x1,y1.r)r`)rQrrr r r create_bitmap szCanvas.create_bitmapcOs|jd||S)z)Create image item with coordinates x1,y1.r)r`)rQrrr r r create_image szCanvas.create_imagecOs|jd||S)z-Create line with coordinates x1,y1,...,xn,yn.line)r`)rQrrr r r create_line" szCanvas.create_linecOs|jd||S)z)Create oval with coordinates x1,y1,x2,y2.Zoval)r`)rQrrr r r create_oval% szCanvas.create_ovalcOs|jd||S)z0Create polygon with coordinates x1,y1,...,xn,yn.Zpolygon)r`)rQrrr r r create_polygon( szCanvas.create_polygoncOs|jd||S)z.Create rectangle with coordinates x1,y1,x2,y2.Z rectangle)r`)rQrrr r r create_rectangle+ szCanvas.create_rectanglecOs|jd||S)z#Create text with coordinates x1,y1.text)r`)rQrrr r r create_text. szCanvas.create_textcOs|jd||S)z+Create window with coordinates x1,y1,x2,y2.r)r`)rQrrr r r create_window1 szCanvas.create_windowcGs!|jj|jdf|dS)zDelete characters of text items identified by tag or id in ARGS (possibly several times) from FIRST to LAST character (including).dcharsN)r.rOr)rQrr r r rl4 sz Canvas.dcharscGs!|jj|jdf|dS)zd|df}|d=n#d|krad|df}|d=tj||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.r=z-classrrN)r'r;rT)rQrRr"rr8r r r rT s   zFrame.__init__)r5r6r7r8rTr r r r r s rc@s(eZdZdZdiddZdS)Labelz0Label widget which can display text and bitmaps.NcKstj||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 labelN)r;rT)rQrRr"rr r r rT$ szLabel.__init__)r5r6r7r8rTr r r r r" s rc@s-eZdZdZdiddZddZddZd d Zdd d Zdd dZ ddZ ddZ ddZ ddZ ddZddZddZeZdddZeZdd ZeZdd!d"ZeZd#d$Zd%d&Zdd'd(ZeZdS))Listboxz3Listbox widget which can display a list of strings.NcKstj||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.ZlistboxN)r;rT)rQrRr"rr r r rT: szListbox.__init__cCs|jj|jd|dS)z"Activate item identified by INDEX.activateN)r.rOr)rQrr r r rC szListbox.activatecCs(|j|jj|jd|p'dS)zxReturn a tuple of X1,Y1,X2,Y2 coordinates for a rectangle which encloses the item identified by the given index.rN)rr.rOr)rQrr r r rF sz Listbox.bboxcCs%|j|jj|jdp$fS)z.Return the indices of currently selected item. curselection)rr.rOr)rQr r r rJ szListbox.curselectioncCs |jj|jd||dS)z+Delete items from FIRST to LAST (included).rN)r.rOr)rQrrr r r rM szListbox.deletecCsQ|dk r4|jj|jj|jd||S|jj|jd|SdS)z0Get list of items from FIRST to LAST (included).Nr\)r.r*rOr)rQrrr r r r\P s z Listbox.getcCs;|jj|jd|}|dkr+dS|jj|S)z+Return index of item identified with INDEX.rrN)r.rOrrw)rQrir r r rW s z Listbox.indexcGs$|jj|jd|f|dS)zInsert ELEMENTS at INDEX.rxN)r.rOr)rQrelementsr r r rx\ szListbox.insertcCs%|jj|jj|jd|S)z5Get index of item which is nearest to y coordinate Y.nearest)r.rwrOr)rQr#r r r r_ szListbox.nearestcCs#|jj|jdd||dS)z&Remember the current X, Y coordinates.rrN)r.rOr)rQrpr#r r r rc szListbox.scan_markcCs#|jj|jdd||dS)zAdjust the view of the listbox to 10 times the difference between X and Y and the coordinates given in scan_mark.rrN)r.rOr)rQrpr#r r r rf szListbox.scan_dragtocCs|jj|jd|dS)z"Scroll such that INDEX is visible.seeN)r.rOr)rQrr r r rk sz Listbox.seecCs |jj|jdd|dS)z-Set the fixed end oft the selection to INDEX.rrN)r.rOr)rQrr r r selection_anchorn szListbox.selection_anchorcCs#|jj|jdd||dS)z2Clear the selection from FIRST to LAST (included).rrN)r.rOr)rQrrr r r rr szListbox.selection_clearcCs(|jj|jj|jdd|S)z+Return 1 if INDEX is part of the selection.rZincludes)r.rNrOr)rQrr r r selection_includesw szListbox.selection_includescCs#|jj|jdd||dS)ziSet the selection from FIRST to LAST (included) without changing the currently selected elements.rrZN)r.rOr)rQrrr r r selection_set| szListbox.selection_setcCs"|jj|jj|jdS)z-Return the number of elements in the listbox.r)r.rwrOr)rQr r r r sz Listbox.sizecCs'|jj|jdf|d|fS)z4Return the resource value for an ITEM and an OPTION.ryr))r.rOr)rQrrr r r ry s zListbox.itemcgetcKs|jd|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.rz)rq)rQrr"rr r r rz szListbox.itemconfigure)r5r6r7r8rTrrrrr\rrxrrrrrZ select_anchorrrrZselect_includesrZ select_setrryrzrr r r r r8 s2               rc@seZdZdZdiddZdddZdd Zd d Zid d ZiddZ iddZ iddZ iddZ iddZ iddZiddZiddZiddZid d!Zid"d#Zdd$d%Zd&d'Zdd(d)ZeZd*d+Zd,d-Zd.d/Zd0d1Zd2d3Zd4d5Zd6d7ZdS)8MenuzPMenu widget which allows displaying menu bars, pull-down menus and pop-up menus.NcKstj||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.menuN)r;rT)rQrRr"rr r r rT sz Menu.__init__rDcCs#|jjd|j|||dS)z/Post the menu at position X,Y with entry ENTRY.tk_popupN)r.rOr)rQrpr#rr r r r sz Menu.tk_popupcCs&ddl}|jdtdddS)Nrz=tk_bindForTraversal() does nothing and will be removed in 3.6rr()rrr)rQrr r r tk_bindForTraversal s  zMenu.tk_bindForTraversalcCs|jj|jd|dS)zActivate entry at INDEX.rN)r.rOr)rQrr r r r sz Menu.activatecKs0|jj|jd|f|j||dS)zInternal function.rN)r.rOrr)rQr_r"rr r r r szMenu.addcKs|jd|p|dS)zAdd hierarchical menu item.cascadeN)r)rQr"rr r r add_cascade szMenu.add_cascadecKs|jd|p|dS)zAdd checkbutton menu item.rN)r)rQr"rr r r add_checkbutton szMenu.add_checkbuttoncKs|jd|p|dS)zAdd command menu item.rN)r)rQr"rr r r add_command szMenu.add_commandcKs|jd|p|dS)zAddd radio menu item. radiobuttonN)r)rQr"rr r r add_radiobutton szMenu.add_radiobuttoncKs|jd|p|dS)zAdd separator. separatorN)r)rQr"rr r r add_separator szMenu.add_separatorcKs3|jj|jd||f|j||dS)zInternal function.rxN)r.rOrr)rQrr_r"rr r r rx sz Menu.insertcKs|j|d|p|dS)z$Add hierarchical menu item at INDEX.rN)rx)rQrr"rr r r insert_cascade szMenu.insert_cascadecKs|j|d|p|dS)z#Add checkbutton menu item at INDEX.rN)rx)rQrr"rr r r insert_checkbutton szMenu.insert_checkbuttoncKs|j|d|p|dS)zAdd command menu item at INDEX.rN)rx)rQrr"rr r r insert_command szMenu.insert_commandcKs|j|d|p|dS)zAddd radio menu item at INDEX.rN)rx)rQrr"rr r r insert_radiobutton szMenu.insert_radiobuttoncKs|j|d|p|dS)zAdd separator at INDEX.rN)rx)rQrr"rr r r insert_separator szMenu.insert_separatorcCs|dkr|}|j||j|}}|dksI|dkrUd\}}x[t||dD]F}d|j|krit|j|d}|ri|j|qiW|jj|jd||dS)z7Delete menu items between INDEX1 and INDEX2 (included).Nrrrrr:)rr:) rr entryconfigr entrycgetrVr.rOr)rQindex1index2Z num_index1Z num_index2rr#r r r r s  z Menu.deletecCs |jj|jd|d|S)z=Return the resource value of a menu item for OPTION at INDEX.rr))r.rOr)rQrrr r r r szMenu.entrycgetcKs|jd|f||S)zConfigure a menu item at INDEX.entryconfigure)rq)rQrr"rr r r r szMenu.entryconfigurecCs;|jj|jd|}|dkr+dS|jj|S)z4Return the index of a menu item identified by INDEX.rrN)r.rOrrw)rQrrr r r r s z Menu.indexcCs|jj|jd|S)zRInvoke a menu item identified by INDEX and execute the associated command.rA)r.rOr)rQrr r r rA sz Menu.invokecCs |jj|jd||dS)zDisplay a menu at position X,Y.postN)r.rOr)rQrpr#r r r r sz Menu.postcCs|jj|jd|S)z*Return the type of the menu item at INDEX.r)r.rOr)rQrr r r r sz Menu.typecCs|jj|jddS)z Unmap a menu.unpostN)r.rOr)rQr r r r sz Menu.unpostcCs%|jj|jj|jd|S)zNReturn the x-position of the leftmost pixel of the menu item at INDEX. xposition)r.rwrOr)rQrr r r r szMenu.xpositioncCs%|jj|jj|jd|S)zEReturn the y-position of the topmost pixel of the menu item at INDEX. yposition)r.rwrOr)rQrr r r r szMenu.yposition)r5r6r7r8rTrrrrrrrrrrxrrrrrrrrrrrArrrrrr r r r r s8          rc@s(eZdZdZdiddZdS) Menubuttonz(Menubutton widget, obsolete since Tk8.0.NcKstj||d||dS)N menubutton)r;rT)rQrRr"rr r r rT szMenubutton.__init__)r5r6r7r8rTr r r r r s rc@s(eZdZdZdiddZdS)MessagezKMessage widget to display multiline text. Obsolete since Label does it too.NcKstj||d||dS)Nmessage)r;rT)rQrRr"rr r r rT szMessage.__init__)r5r6r7r8rTr r r r r s rc@sXeZdZdZdiddZddZddZd d Zd d ZdS) RadiobuttonzGRadiobutton widget which shows only one of several buttons in on-state.NcKstj||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.rN)r;rT)rQrRr"rr r r rT s zRadiobutton.__init__cCs|jj|jddS)zPut the button in off-state.rN)r.rOr)rQr r r r szRadiobutton.deselectcCs|jj|jddS)zFlash the button.r@N)r.rOr)rQr r r r@ szRadiobutton.flashcCs|jj|jdS)zZ!d?d@Z"dAdBZ#dddddddddCdDZ$dEdFZ%dGdHZ&ddIdJZ'ddKdLZ(dMdNZ)ddOdPZ*e*Z+dQdRZ,ddSdTZ-ddUdVZ.ddWdXZ/ddYdZZ0dd[d\Z1d]d^Z2dd_d`Z3dadbZ4ddcddZ5e5Z6idedfZ7dgdhZ8didjZ9dS)kTextz4Text widget which can display text in various forms.NcKstj||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, riN)r;rT)rQrRr"rr r r rTt sz Text.__init__cCs(|j|jj|jd|p'dS)zReturn a tuple of (x,y,width,height) which gives the bounding box of the visible part of the character at the given index.rN)rr.rOr)rQrr r r r sz Text.bboxcCs+|jj|jj|jd|||S)zReturn whether between index INDEX1 and index INDEX2 the relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.compare)r.rNrOr)rQroprr r r r sz Text.comparecGsqdd|D}|||g7}|jj|jd|pAd}|dk rit|dkri|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.cSs)g|]}|jdsd|qS)r)z-%s) startswith)roargr r r rq s zText.count..countN)r.rOrr)rQrrrrr r r r s !z Text.countcCsK|dkr.|jj|jj|jdS|jj|jd|dS)zjTurn on the internal consistency checks of the B-Tree inside the text widget according to BOOLEAN.Ndebug)r.rNrOr)rQrr r r r s "z Text.debugcCs |jj|jd||dS)z?Delete the characters between INDEX1 and INDEX2 (not included).rN)r.rOr)rQrrr r r r sz Text.deletecCs"|j|jj|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. dlineinfo)rr.rOr)rQrr r r r szText.dlineinfoc Ksg}d}d}|s3g}|dd}|}zt|tsX|j|}}|d|g7}x)|D]!} || ro|jd| qoW|j||r|j||jj|jd||SWd|r|j|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|j|||fdS)N)rd)r2rrrr r r append_triple sz Text.dump..append_triplez-commandr)dump)rrrrdr.rOrrV) rQrrrrr func_namerrr2r r r r s*     z Text.dumpcGs|jj|jd|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 edit)r.rOr)rQrr r r r s z Text.editcCs|jd|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. Zmodified)r)rQrr r r edit_modified s zText.edit_modifiedcCs |jdS)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. Zredo)r)rQr r r edit_redo szText.edit_redocCs |jdS)z(Clears the undo and redo stacks reset)r)rQr r r edit_reset szText.edit_resetcCs |jdS)znInserts a separator (boundary) on the undo stack. Does nothing when the undo option is false r)r)rQr r r edit_separator szText.edit_separatorcCs |jdS)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 Zundo)r)rQr r r edit_undo s zText.edit_undocCs|jj|jd||S)z5Return the text from INDEX1 to INDEX2 (not included).r\)r.rOr)rQrrr r r r\ szText.getcCse|dddkr d|}|dddkrF|dd}|jj|jdd||S) z9Return the value of OPTION of an embedded image at INDEX.Nrr)r9rrsr:r:)r.rOr)rQrrr r r image_cget s  zText.image_cgetcKs|jdd|f||S)z%Configure an embedded image at INDEX.rrr)rq)rQrr"rr r r image_configure% szText.image_configurecKs+|jj|jdd||j||S)z"Create an embedded image at INDEX.rr)r.rOrr)rQrr"rr r r image_create( s zText.image_createcCs|jj|jddS)z3Return all names of embedded images in this widget.rr)r.rOr)rQr r r r- szText.image_namescCst|jj|jd|S)z1Return the index in the form line.char for INDEX.r)rr.rOr)rQrr r r r0 sz Text.indexcGs'|jj|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.rxN)r.rOr)rQrcharsrr r r rx3 sz Text.insertcCs"|jj|jdd||fS)zChange the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT). Return the current value if None is given for DIRECTION.rZgravity)r.rOr)rQmarkName directionr r r mark_gravity7 s zText.mark_gravitycCs%|jj|jj|jddS)zReturn all mark names.rr)r.r*rOr)rQr r r mark_names< szText.mark_namescCs#|jj|jdd||dS)z0Set mark MARKNAME before the character at INDEX.rrZN)r.rOr)rQrrr r r mark_set@ sz Text.mark_setcGs$|jj|jddf|dS)zDelete all marks in MARKNAMES.rZunsetN)r.rOr)rQZ markNamesr r r mark_unsetC szText.mark_unsetcCs"|jj|jdd|p!dS)z-Return the name of the next mark after INDEX.rnextN)r.rOr)rQrr r r mark_nextF szText.mark_nextcCs"|jj|jdd|p!dS)z2Return the name of the previous mark before INDEX.rZpreviousN)r.rOr)rQrr r r mark_previousI szText.mark_previouscKs/|jj|jdd||j||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.peerrN)r.rOrr)rQZ newPathNamer"rr r r peer_createL szText.peer_createcCs%|jj|jj|jddS)zYReturns a list of peers of this widget (this does not include the widget itself).rr)r.r*rOr)rQr r r peer_namesS szText.peer_namescGs&|jj|jd||||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.replaceN)r.rOr)rQrrrrr r r rW sz Text.replacecCs#|jj|jdd||dS)z&Remember the current X, Y coordinates.rrN)r.rOr)rQrpr#r r r r^ szText.scan_markcCs#|jj|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.rrN)r.rOr)rQrpr#r r r ra szText.scan_dragtoc Cs |jdg} |r"| jd|r5| jd|rH| jd|r[| jd|rn| jd| r| jd| r| jd| j| |r|d d kr| jd | j|| j||r| j|t|jjt| 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)z--)rrdrr.rOr) rQrrZ stopindexZforwardsZ backwardsexactZregexpZnocaserZeliderr r r rf s.           z Text.searchcCs|jj|jd|dS)z3Scroll such that the character at INDEX is visible.rN)r.rOr)rQrr r r ry szText.seecGs*|jj|jdd||f|dS)z|Add tag TAGNAME to all characters between INDEX1 and index2 in ARGS. Additional pairs of indices may follow in ARGS.tagrN)r.rOr)rQtagNamerrr r r tag_add| s z Text.tag_addcCs9|jj|jdd||d|r5|j|dS)zgUnbind for all characters with TAGNAME for event SEQUENCE the function identified with FUNCID.rr/rDN)r.rOrrV)rQrr+r-r r r rY s"zText.tag_unbindcCs%|j|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.rr/)r.r)rQrr+rrr r r rZ sz Text.tag_bindcCse|dddkr d|}|dddkrF|dd}|jj|jdd||S) z+Return the value of OPTION for tag TAGNAME.Nrr)r9rrsr:r:)r.rOr)rQrrr r r tag_cget s  z Text.tag_cgetcKs|jdd|f||S)zConfigure a tag TAGNAME.rrr)rq)rQrr"rr r r tag_configure szText.tag_configurecGs$|jj|jddf|dS)zDelete all tags in TAGNAMES.rrN)r.rOr)rQZtagNamesr r r tag_delete szText.tag_deletecCs#|jj|jdd||dS)z`Change the priority of tag TAGNAME such that it is lower than the priority of BELOWTHIS.rrN)r.rOr)rQrrr r r r{ szText.tag_lowercCs(|jj|jj|jdd|S)zReturn a list of all tag names.rr)r.r*rOr)rQrr r r tag_names s zText.tag_namescCs.|jj|jj|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.rZ nextrange)r.r*rOr)rQrrrr r r tag_nextrange szText.tag_nextrangecCs.|jj|jj|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.rZ prevrange)r.r*rOr)rQrrrr r r tag_prevrange szText.tag_prevrangecCs#|jj|jdd||dS)zaChange the priority of tag TAGNAME such that it is higher than the priority of ABOVETHIS.rrN)r.rOr)rQrrr r r r~ s zText.tag_raisecCs(|jj|jj|jdd|S)z7Return a list of ranges of text which have tag TAGNAME.rZranges)r.r*rOr)rQrr r r tag_ranges szText.tag_rangescCs&|jj|jdd|||dS)zARemove tag TAGNAME from all characters between INDEX1 and INDEX2.rrkN)r.rOr)rQrrrr r r tag_remove s zText.tag_removecCse|dddkr d|}|dddkrF|dd}|jj|jdd||S) z:Return the value of OPTION of an embedded window at INDEX.Nrr)r9rrsr:r:)r.rOr)rQrrr r r window_cget s  zText.window_cgetcKs|jdd|f||S)z&Configure an embedded window at INDEX.rrr)rq)rQrr"rr r r window_configure szText.window_configurecKs3|jj|jdd|f|j||dS)zCreate a window at INDEX.rrN)r.rOrr)rQrr"rr r r window_create s zText.window_createcCs%|jj|jj|jddS)z4Return all names of embedded windows in this widget.rr)r.r*rOr)rQr r r window_names s zText.window_namescGs$|jj|jddf|dS)zObsolete function, use see.rz -pickplaceN)r.rOr)rQr*r r r yview_pickplace szText.yview_pickplace):r5r6r7r8rTrrrrrrrrrrrrrr\rrrrrrxrrrrrrrrrrrrrrrYrZrrZ tag_configrr{rrrr~rrrrZ window_configrrrr r r r rr sr     (                         rc@s1eZdZdZdddZddZdS)_setitz>Internal class. It wraps the command in the widget OptionMenu.NcCs||_||_||_dS)N) _setit__value _setit__var_setit__callback)rQvarrrfr r r rT s  z_setit.__init__cGs3|jj|j|jr/|j|j|dS)N)rrZrr)rQrr r r r` s z_setit.__call__)r5r6r7r8rTr`r r r r r s rc@s:eZdZdZddZddZddZdS) OptionMenuz?OptionMenu which allows the user to select a value from a menu.c Osddd|dddtddd di}tj||d |d |_t|d d dd}|_|j|_|jd}d|kr|d=|rt d|j d|j d|dt |||x0|D](} |j d| dt || |qW||d s z Image.width)r5r6r7r8r rTrXrWrtrrrrrrr r r r r r  s        r c@seZdZdZdidddZddZddZd d Zd d Zd ddZ d ddZ ddZ dddZ ddddZ dS) PhotoImagez?Widget which can display colored images in GIF, PPM/PGM format.NcKs tj|d||||dS)ztCreate an image with NAME. Valid resource names: data, format, file, gamma, height, palette, width.ZphotoN)r rT)rQrSr"rRrr r r rTE szPhotoImage.__init__cCs|jj|jddS)zDisplay a transparent image.blankN)r.rOrS)rQr r r rK szPhotoImage.blankcCs|jj|jdd|S)zReturn the value of OPTION.rsr))r.rOrS)rQrr r r rsN szPhotoImage.cgetcCs|jj|jdd|S)Nrsr))r.rOrS)rQr2r r r rR szPhotoImage.__getitem__cCs/td|j}|jj|d|j|S)z;Return a new PhotoImage with the same image as this widget.rRcopy)r r.rOrS)rQ destImager r r rU szPhotoImage.copyrDcCsJtd|j}|dkr$|}|jj|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. rRrDrz-zoom)r r.rOrS)rQrpr#rr r r zoomZ s  "zPhotoImage.zoomcCsJtd|j}|dkr$|}|jj|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. rRrDrz -subsample)r r.rOrS)rQrpr#rr r r subsamplec s  "zPhotoImage.subsamplecCs|jj|jd||S)z8Return the color (red, green, blue) of the pixel at X,Y.r\)r.rOrS)rQrpr#r r r r\l szPhotoImage.getcCs`|jd|f}|rL|ddkr8|dd}|dt|}|jj|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)rSrr.rO)rQrrrr r r ro s zPhotoImage.putcCsV|jd|f}|r(|d|f}|rB|dt|}|jj|dS)zRWrite image to file FILENAME in FORMAT starting from position FROM_COORDS.writez-format-fromN)r)rSrr.rO)rQfilenameformatZ from_coordsrr r r ry s zPhotoImage.write)r5r6r7r8rTrrsrrrrr\rrr r r r r C s        r c@s+eZdZdZdidddZdS) BitmapImagez"Widget which can display a bitmap.NcKs tj|d||||dS)zqCreate a bitmap with NAME. Valid resource names: background, data, file, foreground, maskdata, maskfile.rN)r rT)rQrSr"rRrr r r rT szBitmapImage.__init__)r5r6r7r8rTr r r r r s rcCstjjtjjddS)Nrr)r:r.r*rOr r r r r srcCstjjtjjddS)Nrr)r:r.r*rOr r r r r src@seZdZdZdiddZddZdddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zdd!d"ZdS)#Spinboxzspinbox widget.NcKstj||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, ZspinboxN)r;rT)rQrRr"rr r r rT szSpinbox.__init__cCs(|j|jj|jd|p'dS)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. rN)rr.rOr)rQrr r r r s z Spinbox.bboxcCs|jj|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. r)r.rOr)rQrrr r r r s zSpinbox.deletecCs|jj|jdS)zReturns the spinbox's stringr\)r.rOr)rQr r r r\ sz Spinbox.getcCs|jj|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 rw)r.rOr)rQrr r r rw szSpinbox.icursorcCs|jj|jd||S)z{Returns the name of the widget at position x, y Return value is one of: none, buttondown, buttonup, entry r)r.rOr)rQrpr#r r r r szSpinbox.identifycCs|jj|jd|S)z;Returns the numerical index corresponding to index r)r.rOr)rQrr r r r sz Spinbox.indexcCs|jj|jd||S)zDInsert string s at index Returns an empty string. rx)r.rOr)rQrr~r r r rx szSpinbox.insertcCs|jj|jd|S)zCauses the specified element to be invoked The element could be buttondown or buttonup triggering the action associated with it. rA)r.rOr)rQelementr r r rA szSpinbox.invokecGs,|j|jj|jdf|p+fS)zInternal function.r)rr.rOr)rQrr r r r sz Spinbox.scancCs|jd|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. r)r)rQrpr r r r szSpinbox.scan_markcCs|jd|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. r)r)rQrpr r r r s zSpinbox.scan_dragtocGs,|j|jj|jdf|p+fS)zInternal function.r)rr.rOr)rQrr r r r szSpinbox.selectioncCs|jd|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. Returns an empty string. r)r)rQrr r r rs zSpinbox.selection_adjustcCs |jdS)zClear the selection If the selection isn't in this widget then the command has no effect. Returns an empty string. r)r)rQr r r rszSpinbox.selection_clearcCs|jd|S)zSets or gets the currently selected element. If a spinbutton element is specified, it will be displayed depressed r)r)rQrr r r selection_element&szSpinbox.selection_element)r5r6r7r8rTrrr\rwrrrxrArrrrrrrr r r r r s"            rc@s(eZdZdZdiddZdS) LabelFramezlabelframe widget.NcKstj||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 labelframeN)r;rT)rQrRr"rr r r rT2szLabelFrame.__init__)r5r6r7r8rTr r r r r0s rc@seZdZdZdiddZddZddZeZd d Zd d Z d dZ ddZ ddZ ddZ ddZddZddZddZdddZeZdd ZdS)! PanedWindowzpanedwindow widget.NcKstj||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, Z panedwindowN)r;rT)rQrRr"rr r r rTHszPanedWindow.__init__cKs-|jj|jd|f|j|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. rN)r.rOrr)rQrrr r r rXszPanedWindow.addcCs|jj|jd|dS)zRemove the pane containing child from the panedwindow All geometry management options for child will be forgotten. rN)r.rOr)rQrr r r rkbszPanedWindow.removecCs|jj|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)r.rOr)rQrpr#r r r rjs zPanedWindow.identifycGs,|j|jj|jdf|p+fS)zInternal function.proxy)rr.rOr)rQrr r r rvszPanedWindow.proxycCs |jdS)zBReturn the x and y pair of the most recent proxy location coord)r)rQr r r proxy_coord{szPanedWindow.proxy_coordcCs |jdS)z+Remove the proxy from the display. r)r)rQr r r proxy_forgetszPanedWindow.proxy_forgetcCs|jd||S)z:Place the proxy at the given x and y coordinates. r~)r)rQrpr#r r r proxy_placeszPanedWindow.proxy_placecGs,|j|jj|jdf|p+fS)zInternal function.sash)rr.rOr)rQrr r r r$szPanedWindow.sashcCs|jd|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. r )r$)rQrr r r sash_coords zPanedWindow.sash_coordcCs|jd|S)zRecords x and y for the sash given by index; Used in conjunction with later dragto commands to move the sash. r)r$)rQrr r r sash_markszPanedWindow.sash_markcCs|jd|||S)z?Place the sash given by index at the given coordinates r~)r$)rQrrpr#r r r sash_placeszPanedWindow.sash_placecCs'|jj|jdf|d|fS)zwQuery a management option for window. Option may be any value allowed by the paneconfigure subcommand panecgetr))r.rOr)rQrrr r r r(s zPanedWindow.panecgetcKs|dkr)| r)|j|jd|St|tr\| r\|j|jd|d|S|jj|jd|f|j||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))rorrrrpr.rOr)rQrFr"rr r r r)sDzPanedWindow.paneconfigurecCs"|jj|jj|jdS)z+Returns an ordered list of the child panes.panes)r.r*rOr)rQr r r r*szPanedWindow.panes)r5r6r7r8rTrrkrrrr!r"r#r$r%r&r'r(r)Z paneconfigr*r r r r rFs$           KrcCst}dt}|d7}t|d|}|jt|ddd|dd}|j||_t|ddd|j}|j|j|j|j |j dS) NzThis is Tcl/Tk version %su This should be a cedilla: çriz Click me!rcSs|jjdd|jdS)Nriz[%s])testrr)rmr r r  s z_test..ZQUIT) r TclVersionrrxr?r+rrrrr|)rmrirr+r6r r r _tests          r.__main__)Qr8rhrrxZtkinter.constantsrerfloatr rrr-ZREADABLEZWRITABLEZ EXCEPTIONcompilerASCIIrr rrrr'r3r4r9r:r;r=rBrLrCrurvrzr{r|r>rwryrNrr_rrrrr%r&r,r0r5r;r<r?rBrrrrrrrrrrrrrrr r rrrrrrr.r5r r r r s                , r az',/6-A[m!,f %<@