a DOg-,@sLddlZddlZddlTddlmZddlZdZdZdZdZdZd Z d Z d Z d Z d Z dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZGdd d Z Gd!d"d"ej!e Z!Gd#d$d$Z"ej#j$e"fej#_$Gd%d&d&ej#Z%Gd'd(d(e%Z&Gd)d*d*Z'Gd+d,d,e%Z(Gd-d.d.e%Z)Gd/d0d0e%Z*Gd1d2d2e%Z+Gd3d4d4e%Z,Gd5d6d6e%Z-Gd7d8d8e%Z.Gd9d:d:e%Z/Gd;d<dd>e%Z1Gd?d@d@e%Z2GdAdBdBe%Z3GdCdDdDe%Z4GdEdFdFe%e5e6Z7GdGdHdHe%Z8GdIdJdJe%Z9GdKdLdLe%Z:GdMdNdNe%Z;GdOdPdPe%ZGdUdVdVe%Z?GdWdXdXe%Z@GdYdZdZe%ZAGd[d\d\e%ZBGd]d^d^e%ZCGd_d`d`e%ZDGdadbdbe%ZEGdcdddde%ZFGdedfdfe%ZGGdgdhdhe%ZHGdidjdje%ZIGdkdldle%ZJGdmdndne%ZKGdodpdpe%e5e6ZLGdqdrdre%ZMGdsdtdte%ZNGdudvdveOe&ZPGdwdxdxeQe&ZRGdydzdzeSe&ZTGd{d|d|eUe&ZVGd}d~d~eWe&ZXGdddeYe&ZZGddde[e&Z\Gddde]e&Z^Gddde_e&Z`Gdddeae&ZbGdddeDe&ZcGddde7e&ZdGdddeCe&ZeGdddeLe&ZfGddde*e&ZgGddde,e&ZhGddde.e&ZiGddde/e&ZjGddde2e&ZkGddde*e&ZlGdddeKe&ZmGddde>e&ZnGddde@e&ZoddZpddZqGddde%ZrGddde%e5e6ZsGdddesZtdS)N)*) _cnfmergewindowtextstatusZ immediateimageZ imagetextZballoonautoZ acrosstopasciiZcellcolumnZ decreasingZ increasingZintegermainmaxrealrowzs-regionzx-regionzy-region c@sVeZdZdZddZddZdddZdd d Zd d Zd dZ ddZ dddZ dS) tixCommandaThe tix commands provide access to miscellaneous elements of Tix's internal state and the Tix application context. Most of the information manipulated by these commands pertains to the application as a whole, or to a screen or display, rather than to a particular window. This is a mixin class, assumed to be mixed to Tkinter.Tk that supports the self.tk.call method. cCs|jdd|S)aTix maintains a list of directories under which the tix_getimage and tix_getbitmap commands will search for image files. The standard bitmap directory is $TIX_LIBRARY/bitmaps. The addbitmapdir command adds directory into this list. By using this command, the image files of an applications can also be located using the tix_getimage or tix_getbitmap command. tixZ addbitmapdirtkcall)selfZ directoryr#/usr/lib64/python3.9/tkinter/tix.pytix_addbitmapdirRs ztixCommand.tix_addbitmapdircCs|jdd|S)zReturns the current value of the configuration option given by option. Option may be any of the options described in the CONFIGURATION OPTIONS section. rcgetrroptionrrrtix_cget^sztixCommand.tix_cgetNcKsd|rt||f}n |rt|}|dur2|ddSt|trN|ddd|S|jd||S)aQuery or modify the configuration options of the Tix application context. If no option is specified, returns a dictionary all of the available options. 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 option(s) to have the given value(s); in this case the command returns an empty string. Option may be any of the configuration options. Nr configure-)rr!)r _getconfigure isinstancestrZ_getconfigure1rr_optionsrcnfkwrrr tix_configurees   ztixCommand.tix_configurecCs*|dur|jdd|S|jddSdS)aReturns the file selection dialog that may be shared among different calls from this application. This command will create a file selection dialog widget when it is called the first time. This dialog will be returned by all subsequent calls to tix_filedialog. An optional dlgclass parameter can be passed to specified what type of file selection dialog widget is desired. Possible options are tix FileSelectDialog or tixExFileSelectDialog. NrZ filedialogr)rZdlgclassrrrtix_filedialog{s ztixCommand.tix_filedialogcCs|jdd|S)aLocates a bitmap file of the name name.xpm or name in one of the bitmap directories (see the tix_addbitmapdir command above). By using tix_getbitmap, you can avoid hard coding the pathnames of the bitmap files in your application. When successful, it returns the complete pathname of the bitmap file, prefixed with the character '@'. The returned value can be used to configure the -bitmap option of the TK and Tix widgets. rZ getbitmaprrnamerrr tix_getbitmaps ztixCommand.tix_getbitmapcCs|jdd|S)aLocates an image file of the name name.xpm, name.xbm or name.ppm in one of the bitmap directories (see the addbitmapdir command above). If more than one file with the same name (but different extensions) exist, then the image type is chosen according to the depth of the X display: xbm images are chosen on monochrome displays and color images are chosen on color displays. By using tix_ getimage, you can avoid hard coding the pathnames of the image files in your application. When successful, this command returns the name of the newly created image, which can be used to configure the -image option of the Tk and Tix widgets. rZgetimagerr,rrr tix_getimages ztixCommand.tix_getimagecCs|jddd|S)a@Gets the options maintained by the Tix scheme mechanism. Available options include: active_bg active_fg bg bold_font dark1_bg dark1_fg dark2_bg dark2_fg disabled_fg fg fixed_font font inactive_bg inactive_fg input1_bg input2_bg italic_font light1_bg light1_fg light2_bg light2_fg menu_font output1_bg output2_bg select_bg select_fg selector rrgetrr,rrrtix_option_getsztixCommand.tix_option_getcCs2|dur|jdd|||S|jdd||SdS)aResets the scheme and fontset of the Tix application to newScheme and newFontSet, respectively. This affects only those widgets created after this call. Therefore, it is best to call the resetoptions command before the creation of any widgets in a Tix application. The optional parameter newScmPrio can be given to reset the priority level of the Tk options set by the Tix schemes. Because of the way Tk handles the X option database, after Tix has been has imported and inited, it is not possible to reset the color schemes and font sets using the tix config command. Instead, the tix_resetoptions command must be used. NrZ resetoptionsr)rZ newSchemeZ newFontSetZ newScmPriorrrtix_resetoptionssztixCommand.tix_resetoptions)N)N)N) __name__ __module__ __qualname____doc__rr r*r+r.r/r1r2rrrrrGs     rc@s"eZdZdZdddZddZdS) Tkz{Toplevel widget of Tix which represents mostly the main window of an application. It has an associated Tcl interpreter.NTixcCsbtj||||tjd}|jd|durR|jd||jd||jddS)NZ TIX_LIBRARYz|s|jdd|jS|ddkr*d|}|jdd|j|S)NrDinforr"rOrrrrrVs  z Form.infocs(fddjjddjDS)Ncsg|]}|qSr) _nametowidget.0rSrArr zForm.slaves..rDslavesrrRrrFrArrArr\s z Form.slaves)rr)N) r3r4r5r6rGrIrMrNrPrQrVr\rrrrrCs  rCc@sreZdZdZdddiifddZddZddZd d Zd d Zd dZ ddZ ddZ idfddZ ddZ dS) TixWidgetaQA TixWidget class is used to package all (or most) Tix widgets. Widget initialization is extended in two ways: 1) It is possible to give a list of options which must be part of the creation command (so called Tix 'static' options). These cannot be given as a 'config' command later. 2) It is possible to give the name of an existing TK widget. These are child widgets created automatically by a Tix mega-widget. The Tk call to create these widgets is therefore bypassed in TixWidget.__init__ Both options are for use by subclasses only. Nc Cs|rt||f}nt|}d}|r.|dndg}t|D]&\}}||vr@|d||f}||=q@||_t||||r|jj||j g|R|rt ||i|_ dS)Nroptionsr") rappendlistitems widgetNameWidget_setuprrrFrGsubwidget_list) rmasterrcZstatic_optionsr(r)extrakvrrrr:s$  zTixWidget.__init__cCs ||jvr|j|St|dSrH)rfAttributeErrorr,rrr __getattr__Gs  zTixWidget.__getattr__cCs|jd|j|dS)z1Set a variable without calling its action routineZ tixSetSilentNrO)rrLrrr set_silentLszTixWidget.set_silentcCsD||}|s$td|d|j|t|jdd}||S)zSReturn the named subwidget (which must have been created by the sub-class).z Subwidget z not child of N)_subwidget_nameTclError_namelenrFrW)rr-nrrr subwidgetPs  zTixWidget.subwidgetcCsZ|}|sgSg}|D]<}|t|jdd}z|||WqYq0q|S)zReturn all subwidgets.rnN)_subwidget_namesrrrFr`rW)rnamesZretlistr-rrrsubwidgets_allZszTixWidget.subwidgets_allcCs.z|j|jd|WSty(YdS0dS)z7Get a subwidget name (returns a String, not a Widget !)rtN)rrrFrpr,rrrrois zTixWidget._subwidget_namecCs:z |j|jdd}|j|WSty4YdS0dS)z"Return the name of all subwidgets.Z subwidgetsz-allN)rrrFrRrp)rrSrrrrups  zTixWidget._subwidget_namescCs\|dkr dSt|tst|}t|ts0t|}|}|D]}|j|dd||qNr!r")r$r%reprrurr)rrrLrvr-rrr config_allxs  zTixWidget.config_allcKst|s|}|r|rt||f}n|r&|}d}|D]*\}}t|rL||}|d||f}q2|jdd|f|S)Nrr"rcreate)rrbcallable _registerrr)rZimgtyper(rgr)r_rirjrrr image_creates zTixWidget.image_createcCs,z|jdd|Wnty&Yn0dS)Nrdelete)rrrp)rZimgnamerrr image_deletes zTixWidget.image_delete)r3r4r5r6r:rlrmrtrwroruryr}rrrrrr^ s  -   r^c@s"eZdZdZdddZddZdS) TixSubWidgetzSubwidget class. This is used to mirror child widgets automatically created by Tix/Tk as part of a mega-widget in Python (which is not informed of this)rnc Cs|rD||}z$|t|jdd}|d}Wng}Yn0|s`t||ddd|in|}tt|dD]T}d|d|d} z|| } | }Wqtt yt |||ddd}Yqt0qt|r|d}t||ddd|i||_ dS)Nrn.r-r)destroy_physicallycheck_intermediate) rorrrFsplitr^r:rangejoinrWKeyErrorrr) rrgr-rrpathZplistparentirswrrrr:s0     zTixSubWidget.__init__cCsjt|jD] }|q|j|jjvr6|jj|j=|j|jjvrP|jj|j=|jrf|j d|j dS)Nr@) rachildrenvaluesr@rqrgrfrrrrFrcrrrr@s  zTixSubWidget.destroyN)rnrnrBrrrrrs rc@sVeZdZdZifddddZddZdd Zd d Zd d ZifddZ ddZ dS) DisplayStylezRDisplayStyle - handle configuration options shared by (multiple) Display ItemsN)rgcKs^|s2d|vr|d}nd|vr(|d}n td}|j|_|jjd|g|||R|_dS)NZ refwindowzcreate display styleZtixDisplayStyle)r9Z_get_default_rootrrr& stylename)ritemtyper(rgr)rrrr:s     zDisplayStyle.__init__cCs|jSrH)rrArrr__str__szDisplayStyle.__str__cCsH|r|rt||f}n|r|}d}|D]\}}|d||f}q*|S)Nrr")rrb)rr(r)Zoptsrirjrrrr&szDisplayStyle._optionscCs|j|jddSNr~rrrrArrrr~szDisplayStyle.deletecCs|j|jdd||dS)Nr!-%srrJrrrrMszDisplayStyle.__setitem__cKs|j|jdg|||RS)Nr!)r#rr&r'rrrrGs  zDisplayStyle.configcCs|j|jdd|S)Nrrr)rrKrrr __getitem__szDisplayStyle.__getitem__) r3r4r5r6r:rr&r~rMrGrrrrrrs   rc@s2eZdZdZdifddZifddZddZdS) BalloonzBalloon help widget. Subwidget Class --------- ----- label Label message MessageNcKsHgd}t||d|||t|ddd|jd<t|ddd|jd<dS)N)r_ZinstallcolormapZinitwaitZ statusbarZcursorZ tixBalloonlabelrrmessager^r: _dummyLabelrfrrgr(r)Zstaticrrrr: s zBalloon.__init__cKs(|jj|jd|jg|||RdS)zkBind balloon widget to another. One balloon widget may be bound to several widgets at the same timebindNrE)rwidgetr(r)rrr bind_widgetszBalloon.bind_widgetcCs|j|jd|jdSNZunbindrOrrrrr unbind_widgetszBalloon.unbind_widget)r3r4r5r6r:rrrrrrrs rc@s2eZdZdZdifddZifddZddZdS) ButtonBoxzgButtonBox - A container for pushbuttons. Subwidgets are the buttons added with the add method. NcKst||dddg||dS)NZ tixButtonBox orientationr_r^r:rrgr(r)rrrr:s  zButtonBox.__init__cKs6|jj|jd|g|||R}t|||j|<|S)z$Add a button with given name to box.addrrrFr& _dummyButtonrf)rr-r(r)Zbtnrrrr#s"z ButtonBox.addcCs ||jvr|j|jd|dSNinvokerfrrrFr,rrrr*s zButtonBox.invoker3r4r5r6r:rrrrrrrs rc@s>eZdZdZdifddZddZddZd d Zd d ZdS) ComboBoxaComboBox - an Entry field with a dropdown menu. The user can select a choice by either typing in the entry subwidget or selecting from the listbox subwidget. Subwidget Class --------- ----- entry Entry arrow Button slistbox ScrolledListBox tick Button cross Button : present if created with the fancy optionNcKst||dgd||t|d|jd<t|d|jd<t|d|jd<t|d|jd<z$t|d|jd<t|d|jd<WntyYn0dS) NZ tixComboBox)ZeditableZdropdownfancyr_rentryarrowslistboxtickcross)r^r:rrf _dummyEntryr_dummyScrolledListBox TypeErrorrrrrr:<s   zComboBox.__init__cCs|j|jd|dS)NZ addhistoryrOrr%rrr add_historyNszComboBox.add_historycCs|j|jd|dS)NZ appendhistoryrOrrrrappend_historyQszComboBox.append_historycCs|j|jd||dSNinsertrO)rindexr%rrrrTszComboBox.insertcCs|j|jd|dS)NpickrOrrrrrrWsz ComboBox.pick) r3r4r5r6r:rrrrrrrrr.s  rc@s>eZdZdZdifddZddZddZd d Zd d ZdS) ControlaControl - An entry field with value change arrows. The user can adjust the value by pressing the two arrow buttons or by entering the value directly into the entry. The new value will be checked against the user-defined upper and lower limits. Subwidget Class --------- ----- incr Button decr Button entry Entry label LabelNcKsZt||ddg||t|d|jd<t|d|jd<t|d|jd<t|d|jd<dS)NZ tixControlr_incrdecrrr)r^r:rrfrrrrrrr:hs zControl.__init__cCs|j|jddS)NrrOrArrr decrementoszControl.decrementcCs|j|jddS)NrrOrArrr incrementrszControl.incrementcCs|j|jddSrrOrArrrruszControl.invokecCs|j|jddS)NupdaterOrArrrrxszControl.update) r3r4r5r6r:rrrrrrrrrZs  rc@s$eZdZdZifddZddZdS)DirListaRDirList - displays a list view of a directory, its previous directories and its sub-directories. The user can choose one of the directories displayed in the list or change to another directory. Subwidget Class --------- ----- hlist HList hsb Scrollbar vsb ScrollbarcKsJt||ddg||t|d|jd<t|d|jd<t|d|jd<dS)NZ tixDirListr_hlistvsbhsbr^r: _dummyHListrf_dummyScrollbarrrrrr:szDirList.__init__cCs|j|jd|dSNchdirrOrdirrrrrsz DirList.chdirNr3r4r5r6r:rrrrrr{s rc@s$eZdZdZifddZddZdS)DirTreeaDirTree - Directory Listing in a hierarchical view. Displays a tree view of a directory, its previous directories and its sub-directories. The user can choose one of the directories displayed in the list or change to another directory. Subwidget Class --------- ----- hlist HList hsb Scrollbar vsb ScrollbarcKsJt||ddg||t|d|jd<t|d|jd<t|d|jd<dS)NZ tixDirTreer_rrrrrrrrr:szDirTree.__init__cCs|j|jd|dSrrOrrrrrsz DirTree.chdirNrrrrrrs rc@seZdZdZifddZdS) DirSelectBoxaDirSelectBox - Motif style file select box. It is generally used for the user to choose a file. FileSelectBox stores the files mostly recently selected into a ComboBox widget so that they can be quickly selected again. Subwidget Class --------- ----- selection ComboBox filter ComboBox dirlist ScrolledListBox filelist ScrolledListBoxcKs:t||ddg||t|d|jd<t|d|jd<dS)NZtixDirSelectBoxr_dirlistdircbx)r^r: _dummyDirListrf_dummyFileComboBoxrrrrr:szDirSelectBox.__init__Nr3r4r5r6r:rrrrrs rc@s,eZdZdZifddZddZddZdS) ExFileSelectBoxaExFileSelectBox - MS Windows style file select box. It provides a convenient method for the user to select files. Subwidget Class --------- ----- cancel Button ok Button hidden Checkbutton types ComboBox dir ComboBox file ComboBox dirlist ScrolledListBox filelist ScrolledListBoxcKst||ddg||t|d|jd<t|d|jd<t|d|jd<t|d|jd<t|d|jd<t|d|jd<t|d |jd <t|d |jd <dS) NZtixExFileSelectBoxr_cancelokhiddentypesrrfilefilelist)r^r:rrf_dummyCheckbutton_dummyComboBoxrrrrrrr:szExFileSelectBox.__init__cCs|j|jddSNfilterrOrArrrrszExFileSelectBox.filtercCs|j|jddSrrOrArrrrszExFileSelectBox.invokeN)r3r4r5r6r:rrrrrrrs rc@s,eZdZdZifddZddZddZdS) DirSelectDialoga#The DirSelectDialog widget presents the directories in the file system in a dialog window. The user can use this dialog window to navigate through the file system to select the desired directory. Subwidgets Class ---------- ----- dirbox DirSelectDialogcKs*t||ddg||t|d|jd<dS)NZtixDirSelectDialogr_Zdirbox)r^r:_dummyDirSelectBoxrfrrrrr:s zDirSelectDialog.__init__cCs|j|jddSNpopuprOrArrrrszDirSelectDialog.popupcCs|j|jddSNpopdownrOrArrrrszDirSelectDialog.popdownNr3r4r5r6r:rrrrrrrs rc@s,eZdZdZifddZddZddZdS) ExFileSelectDialogzExFileSelectDialog - MS Windows style file select dialog. It provides a convenient method for the user to select files. Subwidgets Class ---------- ----- fsbox ExFileSelectBoxcKs*t||ddg||t|d|jd<dS)NZtixExFileSelectDialogr_fsbox)r^r:_dummyExFileSelectBoxrfrrrrr:s zExFileSelectDialog.__init__cCs|j|jddSrrOrArrrrszExFileSelectDialog.popupcCs|j|jddSrrOrArrrrszExFileSelectDialog.popdownNrrrrrrs rc@s,eZdZdZifddZddZddZdS) FileSelectBoxaExFileSelectBox - Motif style file select box. It is generally used for the user to choose a file. FileSelectBox stores the files mostly recently selected into a ComboBox widget so that they can be quickly selected again. Subwidget Class --------- ----- selection ComboBox filter ComboBox dirlist ScrolledListBox filelist ScrolledListBoxcKsZt||ddg||t|d|jd<t|d|jd<t|d|jd<t|d|jd<dS)NZtixFileSelectBoxr_rrr selection)r^r:rrfrrrrrr:s zFileSelectBox.__init__cCs|j|jddSrrOrArrr apply_filterszFileSelectBox.apply_filtercCs|j|jddSrrOrArrrrszFileSelectBox.invokeN)r3r4r5r6r:rrrrrrrs rc@s,eZdZdZifddZddZddZdS) FileSelectDialogzFileSelectDialog - Motif style file select dialog. Subwidgets Class ---------- ----- btns StdButtonBox fsbox FileSelectBoxcKs:t||ddg||t|d|jd<t|d|jd<dS)NZtixFileSelectDialogr_Zbtnsr)r^r:_dummyStdButtonBoxrf_dummyFileSelectBoxrrrrr:,s  zFileSelectDialog.__init__cCs|j|jddSrrOrArrrr2szFileSelectDialog.popupcCs|j|jddSrrOrArrrr5szFileSelectDialog.popdownNrrrrrr#s rc@s,eZdZdZifddZddZddZdS) FileEntrya_FileEntry - Entry field with button that invokes a FileSelectDialog. The user can type in the filename manually. Alternatively, the user can press the button widget that sits next to the entry, which will bring up a file selection dialog. Subwidgets Class ---------- ----- button Button entry EntrycKs<t||dddg||t|d|jd<t|d|jd<dS)NZ tixFileEntryZ dialogtyper_Zbuttonr)r^r:rrfrrrrrr:Ds   zFileEntry.__init__cCs|j|jddSrrOrArrrrJszFileEntry.invokecCsdSrHrrArrr file_dialogMszFileEntry.file_dialogN)r3r4r5r6r:rrrrrrr8s rc@seZdZdZdifddZifddZdifddZd d Zd d ZdlddZ ddZ ddZ ddZ ddZ ddZddZddZddZifd d!Zifd"d#Zd$d%Zd&d'ZeZd(d)Zd*d+Zd,d-Zifd.d/Zifd0d1Zd2d3Zd4d5Zd6d7Zd8d9Zd:d;Z dd?Z"d@dAZ#dBdCZ$dDdEZ%dFdGZ&dHdIZ'dJdKZ(dLdMZ)dNdOZ*dPdQZ+dRdSZ,ifdTdUZ-ifdVdWZ.dXdYZ/dZd[Z0d\d]Z1ifd^d_Z2d`daZ3dbdcZ4ifdddeZ5dfdgZ6dndhdiZ7djdkZ8dS)oHListaHList - Hierarchy display widget can be used to display any data that have a hierarchical structure, for example, file system directory trees. The list entries are indented and connected by branch lines according to their places in the hierarchy. Subwidgets - NoneNcKst||dddg||dS)NZtixHListcolumnsr_rrrrrr:Ys  zHList.__init__cKs"|jj|jd|g|||RSNrrErrr(r)rrrr]sz HList.addcKs*|sd}|jj|jd|g|||RS)Nr>ZaddchildrE)rrr(r)rrr add_child`s zHList.add_childcCs|j|jdd|dSNanchorsetrOrrrrr anchor_setfszHList.anchor_setcCs|j|jdddSNrclearrOrArrr anchor_cleariszHList.anchor_clearrcCs6|s|j|jdd||S|j|jdd|d|SdS)Nr widthz-charrO)rcolrcharsrrr column_widthls zHList.column_widthcCs|j|jdddS)Nr~allrOrArrr delete_allsszHList.delete_allcCs|j|jdd|dS)Nr~rrOrrrr delete_entryvszHList.delete_entrycCs|j|jdd|dS)Nr~Z offspringsrOrrrrdelete_offspringsyszHList.delete_offspringscCs|j|jdd|dS)Nr~ZsiblingsrOrrrrdelete_siblings|szHList.delete_siblingscCs|j|jdd|dSNdragsiterrOrrrr dragsite_setszHList.dragsite_setcCs|j|jdddSNrrrOrArrrdragsite_clearszHList.dragsite_clearcCs|j|jdd|dSNdropsiterrOrrrr dropsite_setszHList.dropsite_setcCs|j|jdddSNrrrOrArrrdropsite_clearszHList.dropsite_clearcKs(|jj|jdd|g|||RdS)NheaderrzrErrr(r)rrr header_createszHList.header_createcKsB|dur||jdd|S|jj|jdd|g|||RdS)Nrr!r#rFrrr&rrrrheader_configures  zHList.header_configurecCs|j|jdd||S)NrrrO)rroptrrr header_cgetszHList.header_cgetcCs|j|j|jdd|S)NrZexist)rZ getbooleanrrFrrrrr header_existsszHList.header_existscCs|j|jdd|dS)Nrr~rOr rrr header_deleteszHList.header_deletecCs|j|jdd|S)NrsizerOr rrr header_sizeszHList.header_sizecCs|j|jdd|dS)NhiderrOrrrr hide_entryszHList.hide_entrycKs(|jj|jdd|g|||RdS)N indicatorrzrErrrrindicator_creates   zHList.indicator_createcKsB|dur||jdd|S|jj|jdd|g|||RdS)Nr'r!rrrrrindicator_configures   zHList.indicator_configurecCs|j|jdd||S)Nr'rrOrrrrrrindicator_cgetszHList.indicator_cgetcCs|j|jdd|S)Nr'existsrOrrrrindicator_existsszHList.indicator_existscCs|j|jdd|dS)Nr'r~rOrrrrindicator_deleteszHList.indicator_deletecCs|j|jdd|S)Nr'r#rOrrrrindicator_sizeszHList.indicator_sizecCs|j|jddSNrVrrOrArrr info_anchorszHList.info_anchorcCs||j|jdd|pdSNrVZbbox)_getintsrrrFrrrr info_bboxs zHList.info_bboxcCs |j|jdd|}|j|S)NrVrrrrFrR)rrrrrr info_childrenszHList.info_childrencCs|j|jdd|S)NrVdatarOrrrr info_dataszHList.info_datacCs|j|jddS)NrVrrOrArrr info_dragsiteszHList.info_dragsitecCs|j|jddS)NrVrrOrArrr info_dropsiteszHList.info_dropsitecCs|j|jdd|S)NrVr,rOrrrr info_existsszHList.info_existscCs|j|jdd|S)NrVrrOrrrr info_hiddenszHList.info_hiddencCs|j|jdd|S)NrVnextrOrrrr info_nextszHList.info_nextcCs|j|jdd|S)NrVrrOrrrr info_parentszHList.info_parentcCs|j|jdd|S)NrVprevrOrrrr info_prevszHList.info_prevcCs|j|jdd}|j|SNrVrr5rrrrinfo_selectionszHList.info_selectioncCs|j|jdd|||S)NitemrrO)rrrrrrr item_cgetszHList.item_cgetcKsF|dur||jdd||S|jj|jdd||g|||RdS)NrDr!rrrrr(r)rrritem_configures  zHList.item_configurecKs*|jj|jdd||g|||RdS)NrDrzrErFrrr item_creates   zHList.item_createcCs|j|jdd||S)NrDr,rOrrrrrr item_existsszHList.item_existscCs|j|jdd||dS)NrDr~rOrIrrr item_deleteszHList.item_deletecCs|j|jd||S)N entrycgetrOr*rrrrLszHList.entrycgetcKs>|dur||jd|S|jj|jd|g|||RdSNentryconfigurerrrrrrNs  zHList.entryconfigurecCs|j|jd|SNnearestrO)rrTrrrrPsz HList.nearestcCs|j|jd|dSNseerOrrrrrRsz HList.seecKs&|jj|jddg|||RdSNrrrEr'rrrselection_clearszHList.selection_clearcCs|j|jdd|SNrZincludesrOrrrrselection_includes szHList.selection_includescCs|j|jdd||dSNrrrOrfirstlastrrr selection_set szHList.selection_setcCs|j|jdd|S)NshowrrOrrrr show_entryszHList.show_entry)rNN)N)N)9r3r4r5r6r:rrrrr r r r rrrrrrrrr!Z header_existr"r$r&r(r)r+r-r.r/r1r4r6r8r9r:r;r<r>r?rArCrErGrHrJrKrLrNrPrRrTrVr[r]rrrrrQsl            rc@seZdZdZdifddZdS) InputOnlyz?InputOnly - Invisible widget. Unix only. Subwidgets - NoneNcKst||dd||dS)NZ tixInputOnlyrrrrrr:szInputOnly.__init__rrrrrr^sr^c@seZdZdZdifddZdS) LabelEntryaLabelEntry - Entry field with label. Packages an entry widget and a label into one mega widget. It can be used to simplify the creation of ``entry-form'' type of interface. Subwidgets Class ---------- ----- label Label entry EntryNcKs<t||dddg||t|d|jd<t|d|jd<dS)NZ tixLabelEntry labelsider_rr)r^r:rrfrrrrrr:%s   zLabelEntry.__init__rrrrrr_s r_c@seZdZdZdifddZdS) LabelFrameaeLabelFrame - Labelled Frame container. Packages a frame widget and a label into one mega widget. To create widgets inside a LabelFrame widget, one creates the new widgets relative to the frame subwidget and manage them inside the frame subwidget. Subwidgets Class ---------- ----- label Label frame FrameNcKs<t||dddg||t|d|jd<t|d|jd<dS)NZ tixLabelFramer`r_rframe)r^r:rrf _dummyFramerrrrr:6s   zLabelFrame.__init__rrrrrra+s rac@s@eZdZdZifddZifddZddZdd Zd d Zd S) ListNoteBookaA ListNoteBook widget is very similar to the TixNoteBook widget: it can be used to display many windows in a limited space using a notebook metaphor. The notebook is divided into a stack of pages (windows). At one time only one of these pages can be shown. The user can navigate through these pages by choosing the name of the desired page in the hlist subwidget.cKsNt||ddg||t|ddd|jd<t|d|jd<t|d|jd<dS)NZtixListNoteBookr_ZpanerrrZshlist)r^r:_dummyPanedWindowrfr_dummyScrolledHListrrrrr:Es  zListNoteBook.__init__cKs<|jj|jd|g|||Rt|||j|<|j|SrrrrFr&rrfrr-r(r)rrrrMs"zListNoteBook.addcCs ||SrHrtr,rrrpageRszListNoteBook.pagecCs:|j|j|jd}g}|D]}|||q |SNpagesrrRrrFr`rtrrvretrSrrrrlUs zListNoteBook.pagescCs|j|jd|dSNraiserOr,rrr raise_page]szListNoteBook.raise_pageN) r3r4r5r6r:rrjrlrrrrrrrd=s   rdc@seZdZdZdifddZdS)MeterzuThe Meter widget can be used to show the progress of a background job which may take a long time to execute. NcKst||ddg||dS)NZtixMeterr_rrrrrr:es zMeter.__init__rrrrrrs`srsc@sReZdZdZdifddZifddZddZd d Zd d Zd dZ ddZ dS)NoteBookzNoteBook - Multi-page container widget (tabbed notebook metaphor). Subwidgets Class ---------- ----- nbframe NoteBookFrame page widgets added dynamically with the add methodNcKs.t||ddg||t|ddd|jd<dS)NZ tixNoteBookr_Znbframerr)r^r:rrfrrrrr:qszNoteBook.__init__cKs<|jj|jd|g|||Rt|||j|<|j|Srrgrhrrrrvs"z NoteBook.addcCs,|j|jd||j||j|=dSrrrrFrfr@r,rrrr~{szNoteBook.deletecCs ||SrHrir,rrrrjsz NoteBook.pagecCs:|j|j|jd}g}|D]}|||q |Srkrmrnrrrrls zNoteBook.pagescCs|j|jd|dSrprOr,rrrrrszNoteBook.raise_pagecCs|j|jdS)NraisedrOrArrrrvszNoteBook.raised) r3r4r5r6r:rr~rjrlrrrvrrrrrtis rtc@s eZdZdS) NoteBookFrameN)r3r4r5rrrrrwsrwc@sLeZdZdZifddZifddZifddZdd Zd d Zd d Z dS) OptionMenuzOptionMenu - creates a menu button of options. Subwidget Class --------- ----- menubutton Menubutton menu MenucKs:t||ddg||t|d|jd<t|d|jd<dS)NZ tixOptionMenur_ menubuttonmenur^r:_dummyMenubuttonrf _dummyMenurrrrr:szOptionMenu.__init__cKs(|jj|jdd|g|||RdS)NrcommandrErhrrr add_commandszOptionMenu.add_commandcKs(|jj|jdd|g|||RdS)Nr separatorrErhrrr add_separatorszOptionMenu.add_separatorcCs|j|jd|dSrrOr,rrrr~szOptionMenu.deletecCs|j|jd|dS)NdisablerOr,rrrrszOptionMenu.disablecCs|j|jd|dS)NenablerOr,rrrrszOptionMenu.enableN) r3r4r5r6r:rrr~rrrrrrrxs   rxc@sTeZdZdZifddZifddZddZdd Zd d Zifd d Z ddZ dS) PanedWindowaPanedWindow - Multi-pane container widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally.The user changes the sizes of the panes by dragging the resize handle between two panes. Subwidgets Class ---------- ----- g/p widgets added dynamically with the add method.cKst||dddg||dS)NZtixPanedWindowrr_rrrrrr:szPanedWindow.__init__cKs@|jj|jd|g|||Rt||dd|j|<|j|S)Nrr)rrgrhrrrrs " zPanedWindow.addcCs,|j|jd||j||j|=dSrrur,rrrr~szPanedWindow.deletecCs|j|jd|dS)NrPrOr,rrrrPszPanedWindow.forgetcCs|j|jd||S)NpanecgetrOr*rrrrszPanedWindow.panecgetcKs>|dur||jd|S|jj|jd|g|||RdS)N paneconfigurerrrrrrszPanedWindow.paneconfigurecs*jjjd}fdd|DS)Npanescsg|]}|qSrrirXrArrrZr[z%PanedWindow.panes..r])rrvrrArrszPanedWindow.panesN) r3r4r5r6r:rr~rPrrrrrrrrs   rc@s4eZdZdZifddZddZddZdd Zd S) PopupMenuaPopupMenu widget can be used as a replacement of the tk_popup command. The advantage of the Tix PopupMenu widget is it requires less application code to manipulate. Subwidgets Class ---------- ----- menubutton Menubutton menu MenucKs:t||ddg||t|d|jd<t|d|jd<dS)NZ tixPopupMenur_ryrzr{rrrrr:szPopupMenu.__init__cCs|j|jd|jdS)NrrOrrrrrszPopupMenu.bind_widgetcCs|j|jd|jdSrrOrrrrrszPopupMenu.unbind_widgetcCs|j|jd|j||dS)NZpostrO)rrrSrTrrr post_widgetszPopupMenu.post_widgetN)r3r4r5r6r:rrrrrrrrs  rc@s<eZdZdZifddZddZddZdd Zd d Zd S) ResizeHandlez;Internal widget to draw resize handles on Scrolled widgets.cKs gd}t||d|||dS)N) r_r~ZcursorfgZcursorbgZ handlesizeZ hintcolorZ hintwidthrSrTZtixResizeHandler)rrgr(r)flagsrrrr:s zResizeHandle.__init__cCs|j|jd|jdS)NZ attachwidgetrOrrrr attach_widgetszResizeHandle.attach_widgetcCs|j|jd|jdS)NZ detachwidgetrOrrrr detach_widgetszResizeHandle.detach_widgetcCs|j|jd|jdS)Nr%rOrrrrr%szResizeHandle.hidecCs|j|jd|jdS)Nr\rOrrrrr\ szResizeHandle.showN) r3r4r5r6r:rrr%r\rrrrrs  rc@seZdZdZifddZdS) ScrolledHListz0ScrolledHList - HList with automatic scrollbars.cKsJt||ddg||t|d|jd<t|d|jd<t|d|jd<dS)NZtixScrolledHListr_rrrrrrrrr:s zScrolledHList.__init__Nrrrrrr src@seZdZdZifddZdS)ScrolledListBoxz4ScrolledListBox - Listbox with automatic scrollbars.cKsJt||ddg||t|d|jd<t|d|jd<t|d|jd<dS)NZtixScrolledListBoxr_listboxrr)r^r: _dummyListboxrfrrrrrr:szScrolledListBox.__init__Nrrrrrrsrc@seZdZdZifddZdS) ScrolledTextz.ScrolledText - Text with automatic scrollbars.cKsJt||ddg||t|d|jd<t|d|jd<t|d|jd<dS)NZtixScrolledTextr_rrr)r^r: _dummyTextrfrrrrrr:%szScrolledText.__init__Nrrrrrr!src@seZdZdZifddZdS) ScrolledTListz0ScrolledTList - TList with automatic scrollbars.cKsJt||ddg||t|d|jd<t|d|jd<t|d|jd<dS)NZtixScrolledTListr_Ztlistrr)r^r: _dummyTListrfrrrrrr:/s zScrolledTList.__init__Nrrrrrr+src@seZdZdZifddZdS)ScrolledWindowz2ScrolledWindow - Window with automatic scrollbars.cKsJt||ddg||t|d|jd<t|d|jd<t|d|jd<dS)NZtixScrolledWindowr_rrr)r^r:rcrfrrrrrr::szScrolledWindow.__init__Nrrrrrr6src@s0eZdZdZifddZifddZddZdS) SelectzSelect - Container of button subwidgets. It can be used to provide radio-box or check-box style of selection options for the user. Subwidgets are buttons added dynamically using the add method.cKs,t||dgd||t|d|jd<dS)NZ tixSelect)Z allowzeroradiorr`r_rrrrrrr:Gs  zSelect.__init__cKs<|jj|jd|g|||Rt|||j|<|j|SrrrhrrrrNs"z Select.addcCs|j|jd|dSrrOr,rrrrSsz Select.invokeNrrrrrr@s  rc@seZdZdZdifddZdS)Shellz'Toplevel window. Subwidgets - NoneNcKst||dddg||dS)NZtixShellr_titlerrrrrr:[szShell.__init__rrrrrrVsrc@s6eZdZdZdifddZddZddZd d ZdS) DialogShellzToplevel window, with popup popdown and center methods. It tells the window manager that it is a dialog window and should be treated specially. The exact treatment depends on the treatment of the window manager. Subwidgets - NoneNcKst||dgd||dS)NZtixDialogShell)r_rZmappedZ minheightZminwidthrZ transientrrrrrr:gs zDialogShell.__init__cCs|j|jddSrrOrArrrrnszDialogShell.popdowncCs|j|jddSrrOrArrrrqszDialogShell.popupcCs|j|jddS)NcenterrOrArrrrtszDialogShell.center)r3r4r5r6r:rrrrrrrr^s rc@s&eZdZdZdifddZddZdS) StdButtonBoxz@StdButtonBox - Standard Button Box (OK, Apply, Cancel and Help) NcKs\t||dddg||t|d|jd<t|d|jd<t|d|jd<t|d|jd<dS)NZtixStdButtonBoxrr_rapplyrhelp)r^r:rrfrrrrr:zs  zStdButtonBox.__init__cCs ||jvr|j|jd|dSrrr,rrrrs zStdButtonBox.invoke)r3r4r5r6r:rrrrrrwsrc@seZdZdZdifddZddZddZd d Zd d Zd3d dZ ddZ ddZ ddZ ddZ ifddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zifd-d.Zd/d0Zd4d1d2ZdS)5TListaTList - Hierarchy display widget which can be used to display data in a tabular format. The list entries of a TList widget are similar to the entries in the Tk listbox widget. The main differences are (1) the TList widget can display the list entries in a two dimensional format and (2) you can use graphical images as well as multiple colors and fonts for the list entries. Subwidgets - NoneNcKst||ddg||dS)NZtixTListr_rrrrrr:szTList.__init__cCs|j|jdd|dS)NactiverrOrrrr active_setszTList.active_setcCs|j|jdddS)NrrrOrArrr active_clearszTList.active_clearcCs|j|jdd|dSrrOrrrrrszTList.anchor_setcCs|j|jdddSrrOrArrrrszTList.anchor_clearcCs|j|jd||dSrrOrfrom_torrrr~sz TList.deletecCs|j|jdd|dSrrOrrrrrszTList.dragsite_setcCs|j|jdddSrrOrArrrrszTList.dragsite_clearcCs|j|jdd|dSrrOrrrrrszTList.dropsite_setcCs|j|jdddSrrOrArrrrszTList.dropsite_clearcKs&|jj|jd|g|||RdSrrE)rrr(r)rrrrsz TList.insertcCs|j|jddS)NrVrrOrArrr info_activeszTList.info_activecCs|j|jddSr0rOrArrrr1szTList.info_anchorcCs|j|jdd|S)NrVZdownrOrrrr info_downszTList.info_downcCs|j|jdd|S)NrVleftrOrrrr info_leftszTList.info_leftcCs|j|jdd|S)NrVrightrOrrrr info_rightszTList.info_rightcCs|j|jdd}|j|SrBr5rrrrrCszTList.info_selectioncCs|j|jddS)NrVr#rOrArrr info_sizeszTList.info_sizecCs|j|jdd|S)NrVZuprOrrrrinfo_upsz TList.info_upcCs|j|jd||SrOrOrrSrTrrrrPsz TList.nearestcCs|j|jd|dSrQrOrrrrrRsz TList.seecKs&|jj|jddg|||RdSrSrEr'rrrrTszTList.selection_clearcCs|j|jdd|SrUrOrrrrrVszTList.selection_includescCs|j|jdd||dSrWrOrXrrrr[szTList.selection_set)N)N)r3r4r5r6r:rrrrr~rrrrrrr1rrrrCrrrPrRrTrVr[rrrrrs2    rc@sHeZdZdZdifddZddZddZd d Zd d ZdddZ dS)TreezTree - The tixTree widget can be used to display hierarchical data in a tree form. The user can adjust the view of the tree by opening or closing parts of the tree.NcKsJt||ddg||t|d|jd<t|d|jd<t|d|jd<dS)NZtixTreer_rrrrrrrrr:s  z Tree.__init__cCs|j|jddSa This command calls the setmode method for all the entries in this Tree widget: if an entry has no child entries, its mode is set to none. Otherwise, if the entry has any hidden child entries, its mode is set to open; otherwise its mode is set to close. autosetmodeNrOrArrrrszTree.autosetmodecCs|j|jd|dSz8Close the entry given by entryPath if its mode is close.closeNrOr entrypathrrrrsz Tree.closecCs|j|jd|Sz9Returns the current mode of the entry given by entryPath.getmoderOrrrrrsz Tree.getmodecCs|j|jd|dSz6Open the entry given by entryPath if its mode is open.openNrOrrrrrsz Tree.opennonecCs|j|jd||dS)aThis command is used to indicate whether the entry given by entryPath has children entries and whether the children are visible. mode must be one of open, close or none. If mode is set to open, a (+) indicator is drawn next the entry. If mode is set to close, a (-) indicator is drawn next the entry. If mode is set to none, no indicators will be drawn for this entry. The default mode is none. The open mode indicates the entry has hidden children and this entry can be opened by the user. The close mode indicates that all the children of the entry are now visible and the entry can be closed by the user.setmodeNrOrrmoderrrrs z Tree.setmode)r) r3r4r5r6r:rrrrrrrrrrsrc@sZeZdZdZdifddZddZddZd d Zd d ZdddZ ddZ dddZ dS) CheckListzThe CheckList widget displays a list of items to be selected by the user. CheckList acts similarly to the Tk checkbutton or radiobutton widgets, except it is capable of handling many more items than checkbuttons or radiobuttons. NcKsLt||dddg||t|d|jd<t|d|jd<t|d|jd<dS)NZ tixCheckListr_rrrrrrrrrr:s   zCheckList.__init__cCs|j|jddSrrOrArrrrszCheckList.autosetmodecCs|j|jd|dSrrOrrrrrszCheckList.closecCs|j|jd|SrrOrrrrr szCheckList.getmodecCs|j|jd|dSrrOrrrrr$szCheckList.openoncCs|j|j|jd|S)zReturns a list of items whose status matches status. If status is not specified, the list of items in the "on" status will be returned. Mode can be on, off, default getselectionr])rrrrrr(szCheckList.getselectioncCs|j|jd|S)z(Returns the current status of entryPath. getstatusrOrrrrr.szCheckList.getstatuscCs|j|jd||dS)z~Sets the status of entryPath to be status. A bitmap will be displayed next to the entry its status is on, off or default. setstatusNrOrrrrr2szCheckList.setstatus)r)r) r3r4r5r6r:rrrrrrrrrrrrs rc@seZdZdddZdS)rrncCst||||dSrHrr:rrgr-rrrrr:>sz_dummyButton.__init__N)rnr3r4r5r:rrrrr=src@seZdZdddZdS)rrncCst||||dSrHrrrrrr:Bsz_dummyCheckbutton.__init__N)rnrrrrrrAsrc@seZdZdddZdS)rrncCst||||dSrHrrrrrr:Fsz_dummyEntry.__init__N)rnrrrrrrEsrc@seZdZdddZdS)rcrncCst||||dSrHrrrrrr:Jsz_dummyFrame.__init__N)rnrrrrrrcIsrcc@seZdZdddZdS)rrncCst||||dSrHrrrrrr:Nsz_dummyLabel.__init__N)rnrrrrrrMsrc@seZdZdddZdS)rrncCst||||dSrHrrrrrr:Rsz_dummyListbox.__init__N)rnrrrrrrQsrc@seZdZdddZdS)r}rncCst||||dSrHrrrrrr:Vsz_dummyMenu.__init__N)rnrrrrrr}Usr}c@seZdZdddZdS)r|rncCst||||dSrHrrrrrr:Zsz_dummyMenubutton.__init__N)rnrrrrrr|Ysr|c@seZdZdddZdS)rrncCst||||dSrHrrrrrr:^sz_dummyScrollbar.__init__N)rnrrrrrr]src@seZdZdddZdS)rrncCst||||dSrHrrrrrr:bsz_dummyText.__init__N)rnrrrrrrasrc@seZdZdddZdS)rrncCsDt||||t|d|jd<t|d|jd<t|d|jd<dS)Nrrr)rr:rrfrrrrrr:fsz_dummyScrolledListBox.__init__N)rnrrrrrresrc@seZdZdddZdS)rrncCst||||dSrHrrrrrr:msz_dummyHList.__init__N)rnrrrrrrlsrc@seZdZdddZdS)rfrncCsDt||||t|d|jd<t|d|jd<t|d|jd<dSNrrrrr:rrfrrrrrr:qsz_dummyScrolledHList.__init__N)rnrrrrrrfpsrfc@seZdZdddZdS)rrncCst||||dSrHrrrrrr:xsz_dummyTList.__init__N)rnrrrrrrwsrc@seZdZdddZdS)rrncCst|||d|gt|d|jd<t|d|jd<t|d|jd<t|d|jd<z$t|d|jd<t|d|jd<WntyYn0dS)Nrrrrrrr)rr:rrfrrrrrrrrr:|s  z_dummyComboBox.__init__N)rnrrrrrr{src@seZdZdddZdS)rrncCsDt||||t|d|jd<t|d|jd<t|d|jd<dSrrrrrrr:sz_dummyDirList.__init__N)rnrrrrrrsrc@seZdZdddZdS)rrncCs4t||||t|d|jd<t|d|jd<dS)Nrr)rr:rrfrrrrrr:sz_dummyDirSelectBox.__init__N)rnrrrrrrsrc@seZdZdddZdS)rrncCst||||t|d|jd<t|d|jd<t|d|jd<t|d|jd<t|d|jd<t|d|jd<t|d|jd<t|d|jd<dS) Nrrrrrrrr)rr:rrfrrrrrrrr:sz_dummyExFileSelectBox.__init__N)rnrrrrrrsrc@seZdZdddZdS)rrncCsTt||||t|d|jd<t|d|jd<t|d|jd<t|d|jd<dS)Nrrrr)rr:rrfrrrrrr:s z_dummyFileSelectBox.__init__N)rnrrrrrrsrc@seZdZdddZdS)rrncCs$t||||t|d|jd<dS)Nr)rr:rrfrrrrr:sz_dummyFileComboBox.__init__N)rnrrrrrrsrc@seZdZdddZdS)rrncCsTt||||t|d|jd<t|d|jd<t|d|jd<t|d|jd<dS)Nrrrr)rr:rrfrrrrr:s z_dummyStdButtonBox.__init__N)rnrrrrrrsrc@seZdZdddZdS)_dummyNoteBookFramercCst||||dSrHrrrrrr:sz_dummyNoteBookFrame.__init__N)rrrrrrrsrc@seZdZdddZdS)rerncCst||||dSrHrrrrrr:sz_dummyPanedWindow.__init__N)rnrrrrrresrecCs|jd|jS)zzReturns the qualified path name for the widget. Normally used to set default options for subwidgets. See tixwidgets.pyZ tixOptionNamerO)rrrr OptionNamesrcCs:d}|D](}|d|d|d||d}q |S)Nr>z{{z} {z - z}} )keys)dictstyperrr FileTypeLists &rc@seZdZdZdS)CObjViewaBThis file implements the Canvas Object View widget. This is a base class of IconView. It implements automatic placement/adjustment of the scrollbars according to the canvas objects inside the canvas subwidget. The scrollbars are adjusted so that the canvas is just large enough to see all the objects. N)r3r4r5r6rrrrrsrc@seZdZdZdifddZddZddZd d Zd)d d Zd*d dZ ddZ ddZ ddZ d+ddZ ddZddZddZddZdd Zd,d!d"Zd#d$Zd%d&Zd'd(ZdS)-Grida}The Tix Grid command creates a new window and makes it into a tixGrid widget. Additional options, may be specified on the command line or in the option database to configure aspects such as its cursor and relief. A Grid widget displays its contents in a two dimensional grid of cells. Each cell may contain one Tix display item, which may be in text, graphics or other formats. See the DisplayStyle class for more information about Tix display items. Individual cells, or groups of cells, can be formatted with a wide range of attributes, such as its color, relief and border. Subwidgets - NoneNcKs"g}||_t||d|||dS)NZtixGridr(r^r:rrrrr:sz Grid.__init__cCs|j|dddS)zRemoves the selection anchor.rrNrrArrrrszGrid.anchor_clearcCs||j|ddS)z3Get the (x,y) coordinate of the current anchor cellrr0r3rrrArrr anchor_getszGrid.anchor_getcCs|j|dd||dS)z/Set the selection anchor to the cell at (x, y).rrNrrrrrrszGrid.anchor_setcCs4|dur|j|dd|n|j|dd||dS)zdDelete rows between from_ and to inclusive. If to is not provided, delete only row at from_Nr~rrrrrr delete_row szGrid.delete_rowcCs4|dur|j|dd|n|j|dd||dS)zjDelete columns between from_ and to inclusive. If to is not provided, delete only column at from_Nr~r rrrrr delete_columnszGrid.delete_columncCs|j|dddS)zUIf any cell is being edited, de-highlight the cell and applies the changes.editrNrrArrr edit_applyszGrid.edit_applycCs|j|dd||dS)zmHighlights the cell at (x, y) for editing, if the -editnotify command returns True for this cell.rrNrrrrredit_set!sz Grid.edit_setcCs,|r|ddkrd|}|j|d|||S)z&Get the option value for cell at (x,y)rr"rLr)rrSrTrrrrrL&szGrid.entrycgetcKs|d||f||SrM)Z _configure)rrSrTr(r)rrrrN,szGrid.entryconfigurec Cs||j|dd||S)z+Return True if display item exists at (x,y)rVr,)Z _getbooleanrrrrrrr;2szGrid.info_existscCs|j|dd||Sr2rrrrrr46szGrid.info_bboxcCs|j|dd|||dS)zMoves the range of columns from position FROM through TO by the distance indicated by OFFSET. For example, move_column(2, 4, 1) moves the columns 2,3,4 to columns 3,4,5.mover Nrrrroffsetrrr move_column:szGrid.move_columncCs|j|dd|||dS)zMoves the range of rows from position FROM through TO by the distance indicated by OFFSET. For example, move_row(2, 4, 1) moves the rows 2,3,4 to rows 3,4,5.rrNrrrrrmove_row@sz Grid.move_rowcCs||j|d||S)z8Return coordinate of cell nearest pixel coordinate (x,y)rPrrrrrrPFsz Grid.nearestcKs@||j|}|dur"d|f|}|jj|d||g|RdS)Nz -itemtyper)r&r(rr)rrSrTrr)argsrrrrPs zGrid.setcKs,|j|jj|jdd|g|i|RS)aQueries or sets the size of the column given by INDEX. INDEX may be any non-negative integer that gives the position of a given column. INDEX can also be the string "default"; in this case, this command queries or sets the default size of all columns. When no option-value pair is given, this command returns a tuple containing the current size setting of the given column. When option-value pairs are given, the corresponding options of the size setting of the given column are changed. Options may be one of the following: pad0 pixels Specifies the paddings to the left of a column. pad1 pixels Specifies the paddings to the right of a column. size val Specifies the width of a column. Val may be: "auto" -- the width of the column is set to the width of the widest cell in the column; a valid Tk screen distance unit; or a real number following by the word chars (e.g. 3.4chars) that sets the width of the column to the given number of characters.r#r )rrRrrFr&rrr)rrr size_columnVs zGrid.size_columncKs*|j|jj|dd|g|i|RS)aQueries or sets the size of the row given by INDEX. INDEX may be any non-negative integer that gives the position of a given row . INDEX can also be the string "default"; in this case, this command queries or sets the default size of all rows. When no option-value pair is given, this command returns a list con- taining the current size setting of the given row . When option-value pairs are given, the corresponding options of the size setting of the given row are changed. Options may be one of the following: pad0 pixels Specifies the paddings to the top of a row. pad1 pixels Specifies the paddings to the bottom of a row. size val Specifies the height of a row. Val may be: "auto" -- the height of the row is set to the height of the highest cell in the row; a valid Tk screen distance unit; or a real number following by the word chars (e.g. 3.4chars) that sets the height of the row to the given number of characters.r#r)rrRrr&rrrrsize_rowps   z Grid.size_rowcCs|j|jd||dS)z7Clears the cell at (x, y) by removing its display item.unsetNrOrrrrrsz Grid.unset)N)N)N)N)r3r4r5r6r:rrrrrrrrLrNr;r4rrrPrrrrrrrrrs(     rc@seZdZdZdifddZdS) ScrolledGridzScrolled Grid widgetsNcKs"g}||_t||d|||dS)NZtixScrolledGridrrrrrr:szScrolledGrid.__init__rrrrrrsr)ur;r9rZ_tkinterZWINDOWZTEXTZSTATUSZ IMMEDIATEZIMAGEZ IMAGETEXTZBALLOONZAUTOZ ACROSSTOPASCIIZCELLZCOLUMNZ DECREASINGZ INCREASINGZINTEGERZMAINMAXZREALZROWZS_REGIONZX_REGIONZY_REGIONZ TCL_DONT_WAITZTCL_WINDOW_EVENTSZTCL_FILE_EVENTSZTCL_TIMER_EVENTSZTCL_IDLE_EVENTSZTCL_ALL_EVENTSrr7rCrd __bases__r^rrrrrrrrrrrrrrrZXViewZYViewrr^r_rardrsrtrwrxrrrrrrrrrrrrrrrZButtonrZ CheckbuttonrZEntryrZFramercZLabelrZListboxrZMenur}Z Menubuttonr|Z ScrollbarrTextrrrrfrrrrrrrrrrerrrrrrrrrs - 8/,!"C# ()     S.6    *