zfc@sxddlZddlZddlTddlmZmZedkrPednddlZdZdZdZ d Z d Z d Z d Z d ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d!Z"d"dd#YZ#d$ej$e#fd%YZ$d&dd'YZ%ej&j'e%fej&_'d(ej&fd)YZ(d*e(fd+YZ)d,dd-YZ*d.e(fd/YZ+d0e(fd1YZ,d2e(fd3YZ-d4e(fd5YZ.d6e(fd7YZ/d8e(fd9YZ0d:e(fd;YZ1d<e(fd=YZ2d>e(fd?YZ3d@e(fdAYZ4dBe(fdCYZ5dDe(fdEYZ6dFe(fdGYZ7dHe(e8e9fdIYZ:dJe(fdKYZ;dLe(fdMYZ<dNe(fdOYZ=dPe(fdQYZ>dRe(fdSYZ?dTe(fdUYZ@dVe(fdWYZAdXe(fdYYZBdZe(fd[YZCd\e(fd]YZDd^e(fd_YZEd`e(fdaYZFdbe(fdcYZGdde(fdeYZHdfe(fdgYZIdhe(fdiYZJdje(fdkYZKdle(fdmYZLdne(fdoYZMdpe(fdqYZNdre(e8e9fdsYZOdte(fduYZPdve(fdwYZQdxeRe)fdyYZSdzeTe)fd{YZUd|eVe)fd}YZWd~eXe)fdYZYdeZe)fdYZ[de\e)fdYZ]de^e)fdYZ_de`e)fdYZadebe)fdYZcdede)fdYZedeGe)fdYZfde:e)fdYZgdeFe)fdYZhdeOe)fdYZide-e)fdYZjde/e)fdYZkde1e)fdYZlde2e)fdYZmde5e)fdYZnde-e)fdYZodeNe)fdYZpdeAe)fdYZqdeCe)fdYZrdZsdZtde(fdYZude(e8e9fdYZvdevfdYZwdS(iN(t*(t_flattent _cnfmergegˡE@s0This version of Tix.py requires Tk 4.0 or highertwindowttexttstatust immediatetimaget imagetexttballoontautot acrosstoptasciitcelltcolumnt decreasingt increasingtintegertmaintmaxtrealtrowss-regionsx-regionsy-regioniiiiiit tixCommandcBs_eZdZdZdZd dZd dZdZdZ dZ d dZ 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|jjdd|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 addbitmapdir(ttktcall(tselft directory((s"/usr/lib64/python2.7/lib-tk/Tix.pyttix_addbitmapdirVs cCs|jjdd|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. Rtcget(RR(Rtoption((s"/usr/lib64/python2.7/lib-tk/Tix.pyttix_cgetbscKs|rt||f}n|r0t|}n|dkrL|jddSt|trr|jddd|S|jjd|j|S(sQuery 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. Rt configuret-N(RR!( RtNonet _getconfiguret isinstancet StringTypet_getconfigure1RRt_options(Rtcnftkw((s"/usr/lib64/python2.7/lib-tk/Tix.pyt tix_configureis  cCs9|dk r"|jjdd|S|jjddSdS(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. Rt filedialogN(R#RR(Rtdlgclass((s"/usr/lib64/python2.7/lib-tk/Tix.pyttix_filedialogs cCs|jjdd|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. Rt getbitmap(RR(Rtname((s"/usr/lib64/python2.7/lib-tk/Tix.pyt tix_getbitmaps cCs|jjdd|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 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. Rtgetimage(RR(RR0((s"/usr/lib64/python2.7/lib-tk/Tix.pyt tix_getimages cCs|jjddd|S(s@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 RRtget(RR(RR0((s"/usr/lib64/python2.7/lib-tk/Tix.pyttix_option_getscCsE|dk r(|jjdd|||S|jjdd||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. Rt resetoptionsN(R#RR(Rt newSchemet newFontSett newScmPrio((s"/usr/lib64/python2.7/lib-tk/Tix.pyttix_resetoptionss N( t__name__t __module__t__doc__RR R#R+R.R1R3R5R:(((s"/usr/lib64/python2.7/lib-tk/Tix.pyRKs      tTkcBs)eZdZddddZdZRS(s{Toplevel widget of Tix which represents mostly the main window of an application. It has an associated Tcl interpreter.tTixcCstjj||||tjjd}|jjd|dk rr|jjd||jjd|n|jjddS(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( tTkinterR>t__init__tostenvironR4RtevalR#(Rt screenNametbaseNamet classNamettixlib((s"/usr/lib64/python2.7/lib-tk/Tix.pyRBs cCs$|jddtjj|dS(NtWM_DELETE_WINDOWt(tprotocolRAR>tdestroy(R((s"/usr/lib64/python2.7/lib-tk/Tix.pyRMsN(R;R<R=R#RBRM(((s"/usr/lib64/python2.7/lib-tk/Tix.pyR>stFormcBs_eZdZidZeZdZdZdZdddZd dZ dZ RS( sThe Tix Form geometry manager Widgets can be arranged by specifying attachments to other widgets. See Tix documentation for complete detailscKs)|jjd|j|j||dS(NttixForm(RRt_wR((RR)R*((s"/usr/lib64/python2.7/lib-tk/Tix.pytconfigscCstj|i||6dS(N(RNtform(Rtkeytvalue((s"/usr/lib64/python2.7/lib-tk/Tix.pyt __setitem__scCs|jjdd|jS(NROtcheck(RRRP(R((s"/usr/lib64/python2.7/lib-tk/Tix.pyRVscCs|jjdd|jdS(NROtforget(RRRP(R((s"/usr/lib64/python2.7/lib-tk/Tix.pyRWsicCs| ro| ro|jjdd|j}|jj|}d}x'|D]}||jj|f}qHW|S|jjdd|j||S(NROtgrid((RRRPt splitlisttgetint(Rtxsizetysizetxtytz((s"/usr/lib64/python2.7/lib-tk/Tix.pyRXs cCsX|s|jjdd|jS|ddkr<d|}n|jjdd|j|S(NROtinfoiR"(RRRP(RR((s"/usr/lib64/python2.7/lib-tk/Tix.pyR`s  cCs1t|j|jj|jjdd|jS(NROtslaves(tmapt _nametowidgetRRYRRP(R((s"/usr/lib64/python2.7/lib-tk/Tix.pyRas   N( R;R<R=RQRRRURVRWRXR#R`Ra(((s"/usr/lib64/python2.7/lib-tk/Tix.pyRNs     t TixWidgetcBs}eZdZd d d iidZdZdZdZdZdZ dZ dZ id d 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|rt||f}n t|}d}|rC|jdn dg}xE|jD]6\}}||krZ|d||f}||=qZqZW||_tj||||r|jj||j|n|rtj ||ni|_ dS(NtoptionsR"(( Rtappendtitemst widgetNametWidgett_setupRRRPRQtsubwidget_list( RtmasterRhtstatic_optionsR)R*textratktv((s"/usr/lib64/python2.7/lib-tk/Tix.pyRBs$    cCs'||jkr|j|St|dS(N(RktAttributeError(RR0((s"/usr/lib64/python2.7/lib-tk/Tix.pyt __getattr__Ks cCs|jjd|j|dS(s1Set a variable without calling its action routinet tixSetSilentN(RRRP(RRT((s"/usr/lib64/python2.7/lib-tk/Tix.pyt set_silentPscCsT|j|}|s0td|d|jn|t|jd}|j|S(sSReturn the named subwidget (which must have been created by the sub-class).s Subwidget s not child of i(t_subwidget_nametTclErrort_nametlenRPRc(RR0tn((s"/usr/lib64/python2.7/lib-tk/Tix.pyt subwidgetTs cCsl|j}|sgSg}xI|D]A}|t|jd}y|j|j|Wq#q#Xq#W|S(sReturn all subwidgets.i(t_subwidget_namesRxRPRfRc(RtnamestretlistR0((s"/usr/lib64/python2.7/lib-tk/Tix.pytsubwidgets_all^s  cCs6y|jj|jd|SWntk r1dSXdS(s7Get a subwidget name (returns a String, not a Widget !)RzN(RRRPRvR#(RR0((s"/usr/lib64/python2.7/lib-tk/Tix.pyRums cCsHy/|jj|jdd}|jj|SWntk rCdSXdS(s"Return the name of all subwidgets.t subwidgetss-allN(RRRPRYRvR#(RR]((s"/usr/lib64/python2.7/lib-tk/Tix.pyR{ts  cCs|dkrdSt|ts.t|}nt|tsLt|}n|j}x+|D]#}|jj|dd||q_WdS(s8Set configuration options for all subwidgets (and self).RKNR!R"(R%R&treprR{RR(RRRTR|R0((s"/usr/lib64/python2.7/lib-tk/Tix.pyt config_all|s   cKs|s$tj}|s$tdq$n|rE|rEt||f}n|rT|}nd}xO|jD]A\}}t|dr|j|}n|d||f}qgW|jjdd|f|S(NsToo early to create imaget__call__R"Rtcreate(( RAt _default_roott RuntimeErrorRRgthasattrt _registerRR(RtimgtypeR)RlR*ReRoRp((s"/usr/lib64/python2.7/lib-tk/Tix.pyt image_creates   cCs2y|jjdd|Wntk r-nXdS(NRtdelete(RRRv(Rtimgname((s"/usr/lib64/python2.7/lib-tk/Tix.pyt image_deletes N(R;R<R=R#RBRrRtRzR~RuR{RRR(((s"/usr/lib64/python2.7/lib-tk/Tix.pyRds ,       t TixSubWidgetcBs&eZdZdddZdZRS(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 CsE|rR|j|}y*|t|jd}|jd}WqRg}qRXn|s{tj||ddi|d6n|}xtt|dD]i}dj||d } y|j | } | }Wqt k rt |||dddd}qXqW|r|d}ntj||ddi|d6||_ dS(Nit.R0tdestroy_physicallyitcheck_intermediatei( RuRxRPtsplitRdRBR#trangetjoinRctKeyErrorRR( RRlR0RRtpathtplisttparenttiRytw((s"/usr/lib64/python2.7/lib-tk/Tix.pyRBs. #    cCsx!|jjD]}|jqW|j|jjkrL|jj|j=n|j|jjkrt|jj|j=n|jr|jjd|j ndS(NRM( tchildrentvaluesRMRwRlRkRRRRP(Rtc((s"/usr/lib64/python2.7/lib-tk/Tix.pyRMs (R;R<R=RBRM(((s"/usr/lib64/python2.7/lib-tk/Tix.pyRst DisplayStylecBsSeZdZidZdZdZdZdZidZdZ RS(sRDisplayStyle - handle configuration options shared by (multiple) Display ItemscKsd|kr|d}n7d|kr2|d}ntj}|sPtdn|j|_|jjd||j|||_dS(Nt refwindows1Too early to create display style: no root windowttixDisplayStyle(RARRRRR(t stylename(RtitemtypeR)R*Rl((s"/usr/lib64/python2.7/lib-tk/Tix.pyRBs      cCs|jS(N(R(R((s"/usr/lib64/python2.7/lib-tk/Tix.pyt__str__scCsk|r!|r!t||f}n|r0|}nd}x.|jD] \}}|d||f}qCW|S(NR"((RRg(RR)R*toptsRoRp((s"/usr/lib64/python2.7/lib-tk/Tix.pyR(s  cCs|jj|jddS(NR(RRR(R((s"/usr/lib64/python2.7/lib-tk/Tix.pyRscCs$|jj|jdd||dS(NR!s-%s(RRR(RRSRT((s"/usr/lib64/python2.7/lib-tk/Tix.pyRUscKs"|j|jd|j||S(NR!(R$RR((RR)R*((s"/usr/lib64/python2.7/lib-tk/Tix.pyRQscCs|jj|jdd|S(NRs-%s(RRR(RRS((s"/usr/lib64/python2.7/lib-tk/Tix.pyt __getitem__s( R;R<R=RBRR(RRURQR(((s"/usr/lib64/python2.7/lib-tk/Tix.pyRs    tBallooncBs2eZdZdidZidZdZRS(sBalloon help widget. Subwidget Class --------- ----- label Label message MessagecKsmdddddg}tj||d|||t|ddd |jd