m %UIc@s.dkTdklZlZlZedjo edndkZdZdZdZ dZ d Z d Z d Z d Zd Zdd>Zdd>Zdd>Zdd>Zdd>ZdZdkZdkZdfdYZdeiefdYZdfdYZeiiefei_deifdYZdefdYZdZdfd YZd!efd"YZ d#efd$YZ!d%efd&YZ"d'efd(YZ#d)efd*YZ$d+efd,YZ%d-efd.YZ&d/efd0YZ'd1efd2YZ(d3efd4YZ)d5efd6YZ*d7efd8YZ+d9efd:YZ,d;efd<YZ-d=efd>YZ.d?efd@YZ/dAefdBYZ0dCefdDYZ1dEefdFYZ2dGefdHYZ3dIefdJYZ4dKefdLYZ5dMefdNYZ6dOefdPYZ7dQefdRYZ8dSefdTYZ9dUefdVYZ:dWefdXYZ;dYefdZYZ<d[efd\YZ=d]efd^YZ>d_efd`YZ?daefdbYZ@dcefddYZAdeefdfYZBdgefdhYZCdiefdjYZDdkeEefdlYZFdmeGefdnYZHdoeIefdpYZJdqeKefdrYZLdseMefdtYZNdueOefdvYZPdweQefdxYZRdyeSefdzYZTd{eUefd|YZVd}eWefd~YZXde:efdYZYde-efdYZZde9efdYZ[deBefdYZ\de"efdYZ]de$efdYZ^de&efdYZ_de'efdYZ`de*efdYZade"efdYZbdeAefdYZcde4efdYZdde6efdYZedZfdZgdefdYZhdefdYZidefdYZjdS((t*(s_flattens _cnfmerges _default_rootf3.9990000000000001s0This version of Tix.py requires Tk 4.0 or higherNtwindowttexttstatust immediatetimaget imagetexttballoontautot acrosstopiiiiiit tixCommandcBs_tZdZdZdZedZedZdZdZ dZ edZ RS( sThe 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|iidd|S(sTix 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. ttixt addbitmapdirN(tselfttktcallt directory(R R((t'/data/zmath/lib/python2.4/lib-tk/Tix.pyttix_addbitmapdirJs cCs|iidd|S(sReturns the current value of the configuration option given by option. Option may be any of the options described in the CONFIGURATION OPTIONS section. R tcgetN(R RRtoption(R R((Rttix_cgetVscKs|ot||f}n|ot|}n|djo_h}xN|ii|iiddD]+}|ddf|d||dd|dj o|iidd|Sn|iiddSdS(sReturns 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. R t filedialogN(tdlgclassRR RR(R R#((Rttix_filedialogws cCs|iidd|S(sLocates 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. R t getbitmapN(R RRtname(R R&((Rt tix_getbitmapscCs|iidd|S(sLocates 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 advoid 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. R tgetimageN(R RRR&(R R&((Rt tix_getimages cCs|iiddd|S(s@Gets the options manitained 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 R RtgetN(R RRR&(R R&((Rttix_option_gets cCsJ|dj o |iidd|||Sn|iidd||SdS(sResets 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. R t resetoptionsN(t newScmPrioRR RRt newSchemet newFontSet(R R.R/R-((Rttix_resetoptionss  ( t__name__t __module__t__doc__RRRR!R$R'R)R+R0(((RR ?s      tTkcBs)tZdZeeddZdZRS(s{Toplevel widget of Tix which represents mostly the main window of an application. It has an associated Tcl interpreter.tTixcCstii||||tii d}|i i d|dj o,|i i d||i i d|n|i i ddS(Nt TIX_LIBRARYs<global auto_path; lappend auto_path [file dir [info nameof]]s(global auto_path; lappend auto_path {%s}s,global tcl_pkgPath; lappend tcl_pkgPath {%s}spackage require Tix(tTkinterR4t__init__R t screenNametbaseNamet classNametostenvironR*ttixlibRtevalR(R R9R:R;R>((RR8s cCs$|iddtii|dS(NtWM_DELETE_WINDOWt(R tprotocolR7R4tdestroy(R ((RRCs(R1R2R3RR8RC(((RR4s tFormcBs_tZdZhdZeZdZdZdZdddZe dZ dZ RS( sThe Tix Form geometry manager Widgets can be arranged by specifying attachments to other widgets. See Tix documentation for complete detailscKs)|iid|i|i||dS(NttixForm(R RRt_wR RR(R RR((RtconfigscCsti|h||<dS(N(RDtformR tkeytvalue(R RIRJ((Rt __setitem__scCs|iidd|iS(NREtcheck(R RRRF(R ((RRLscCs|iidd|idS(NREtforget(R RRRF(R ((RRMsicCs| om| oe|iidd|i}|ii|}f}x'|D]}||ii |f}qJW|Sn|iidd|i||S(NREtgrid( txsizetysizeR RRRFRt splitlisttytztgetint(R RORPRRRRS((RRNscCs_|p|iidd|iSn|ddjod|}n|iidd|i|S(NREtinfoiR(RR RRRF(R R((RRUs cCs1t|i|ii|iidd|iS(NREtslaves(tmapR t _nametowidgetRRQRRF(R ((RRVs ( R1R2R3RGRHRKRLRMRNRRURV(((RRDs      t TixWidgetcBs}tZdZeeehhdZdZdZdZdZdZ dZ dZ hed Z d Z RS( sQA 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. c Cs|ot||f}n t|}f}|o|idn dg}xG|iD]8\}}||jo|d||f}||=q^q^W||_ t i ||||o|ii||i|n|ot i||nh|_dS(NtoptionsR(RRRtextratstatic_optionstappendtitemstktvt widgetNameR tWidgett_setuptmasterRRRFRGtsubwidget_list( R RdRaR\RRR[R`R_((RR8s&     cCs/|ii|o|i|Snt|dS(N(R Rethas_keyR&tAttributeError(R R&((Rt __getattr__CscCs|iid|i|dS(s1Set a variable without calling its action routinet tixSetSilentN(R RRRFRJ(R RJ((Rt set_silentHscCsV|i|}|ptd|d|in|t|id}|i|S(sSReturn the named subwidget (which must have been created by the sub-class).s Subwidget s not child of iN( R t_subwidget_nameR&tntTclErrort_nametlenRFRX(R R&Rl((Rt subwidgetLs cCsq|i}|pgSng}xI|D]A}|t|id}y|i|i|Wq(q(Xq(W|S(sReturn all subwidgets.iN( R t_subwidget_namestnamestretlistR&RoRFR]RX(R RrRsR&((Rtsubwidgets_allVs cCs;y|ii|id|SWntj o dSnXdS(s7Get a subwidget name (returns a String, not a Widget !)RpN(R RRRFR&RmR(R R&((RRkes cCsMy/|ii|idd}|ii|SWntj o dSnXdS(s"Return the name of all subwidgets.t subwidgetss-allN(R RRRFRRRmR(R R((RRqls cCs|djodSn!t|tpt|}nt|tpt|}n|i}x+|D]#}|i i |dd||qhWdS(s8Set configuration options for all subwidgets (and self).RANRR( RRRtreprRJR RqRrR&RR(R RRJRrR&((Rt config_allts  cKs|p!ti}|p tdq(n|o|ot||f}n|o |}nf}xN|iD]@\}}t |o|i |}n|d||f}qpW|iidd|f|S(NsToo early to create imageRRtcreate(RdR7t _default_roott RuntimeErrorRRRRZR^R_R`tcallableR t _registerRRtimgtype(R R}RRdRRZR`R_((Rt image_creates    cCs4y|iidd|Wntj onXdS(NRtdelete(R RRtimgnameRm(R R((Rt image_deletes(R1R2R3RR8RhRjRpRtRkRqRwR~R(((RRY s -       t TixSubWidgetcBs&tZdZdddZdZRS(sSubwidget 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)ic CsP|oM|i|} y*| t|id} | id} WqTg} qTXn| pt| djo&t i ||ddhd|<n|}xtt| dD]k}di| |d }y|i|}|}Wqtj o&t|| |dddd}qXqWt i ||ddhd|<||_dS(Nit.iR&tdestroy_physicallyitcheck_intermediate(RRdRkR&tpathRoRFRtplistRYR8R RtparenttrangetitjoinRlRXtwtKeyErrorRR( R RdR&RRRRRlRRR((RR8s,&  "cCsx!|iiD]}|iqW|iii|io|ii|i=n|iii|io|ii|i=n|i o|i i d|i ndS(NRC( R tchildrentvaluestcRCRdRfRnReRRRRF(R R((RRCs (R1R2R3R8RC(((RRs cCs@h}x3|D]+}|ddf|d||dd