�ɲɾ�����ӯ�����һ��ˣ��������С���˴��ͣ�������P���ҹ��ñ˽��ά�Բ��������˸߸ԣ�������ơ��ҹ��ñ�����ά�Բ���ˡ���˳^�ӣ������ӡ� ���ͯj�ӣ��ƺ���ӣ� ? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!PK,/1]a”++tkSimpleDialog.pynu[# # An Introduction to Tkinter # tkSimpleDialog.py # # Copyright (c) 1997 by Fredrik Lundh # # fredrik@pythonware.com # http://www.pythonware.com # # -------------------------------------------------------------------- # dialog base class '''Dialog boxes This module handles dialog boxes. It contains the following public symbols: Dialog -- a base class for dialogs askinteger -- get an integer from the user askfloat -- get a float from the user askstring -- get a string from the user ''' from Tkinter import * class Dialog(Toplevel): '''Class to open dialogs. This class is intended as a base class for custom dialogs ''' def __init__(self, parent, title = None): '''Initialize a dialog. Arguments: parent -- a parent window (the application window) title -- the dialog title ''' Toplevel.__init__(self, parent) self.withdraw() # remain invisible for now # If the master is not viewable, don't # make the child transient, or else it # would be opened withdrawn if parent.winfo_viewable(): self.transient(parent) if title: self.title(title) self.parent = parent self.result = None body = Frame(self) self.initial_focus = self.body(body) body.pack(padx=5, pady=5) self.buttonbox() if not self.initial_focus: self.initial_focus = self self.protocol("WM_DELETE_WINDOW", self.cancel) if self.parent is not None: self.geometry("+%d+%d" % (parent.winfo_rootx()+50, parent.winfo_rooty()+50)) self.deiconify() # become visibile now self.initial_focus.focus_set() # wait for window to appear on screen before calling grab_set self.wait_visibility() self.grab_set() self.wait_window(self) def destroy(self): '''Destroy the window''' self.initial_focus = None Toplevel.destroy(self) # # construction hooks def body(self, master): '''create dialog body. return widget that should have initial focus. This method should be overridden, and is called by the __init__ method. ''' pass def buttonbox(self): '''add standard button box. override if you do not want the standard buttons ''' box = Frame(self) w = Button(box, text="OK", width=10, command=self.ok, default=ACTIVE) w.pack(side=LEFT, padx=5, pady=5) w = Button(box, text="Cancel", width=10, command=self.cancel) w.pack(side=LEFT, padx=5, pady=5) self.bind("", self.ok) self.bind("", self.cancel) box.pack() # # standard button semantics def ok(self, event=None): if not self.validate(): self.initial_focus.focus_set() # put focus back return self.withdraw() self.update_idletasks() try: self.apply() finally: self.cancel() def cancel(self, event=None): # put focus back to the parent window if self.parent is not None: self.parent.focus_set() self.destroy() # # command hooks def validate(self): '''validate the data This method is called automatically to validate the data before the dialog is destroyed. By default, it always validates OK. ''' return 1 # override def apply(self): '''process the data This method is called automatically to process the data, *after* the dialog is destroyed. By default, it does nothing. ''' pass # override # -------------------------------------------------------------------- # convenience dialogues class _QueryDialog(Dialog): def __init__(self, title, prompt, initialvalue=None, minvalue = None, maxvalue = None, parent = None): if not parent: import Tkinter parent = Tkinter._default_root self.prompt = prompt self.minvalue = minvalue self.maxvalue = maxvalue self.initialvalue = initialvalue Dialog.__init__(self, parent, title) def destroy(self): self.entry = None Dialog.destroy(self) def body(self, master): w = Label(master, text=self.prompt, justify=LEFT) w.grid(row=0, padx=5, sticky=W) self.entry = Entry(master, name="entry") self.entry.grid(row=1, padx=5, sticky=W+E) if self.initialvalue is not None: self.entry.insert(0, self.initialvalue) self.entry.select_range(0, END) return self.entry def validate(self): import tkMessageBox try: result = self.getresult() except ValueError: tkMessageBox.showwarning( "Illegal value", self.errormessage + "\nPlease try again", parent = self ) return 0 if self.minvalue is not None and result < self.minvalue: tkMessageBox.showwarning( "Too small", "The allowed minimum value is %s. " "Please try again." % self.minvalue, parent = self ) return 0 if self.maxvalue is not None and result > self.maxvalue: tkMessageBox.showwarning( "Too large", "The allowed maximum value is %s. " "Please try again." % self.maxvalue, parent = self ) return 0 self.result = result return 1 class _QueryInteger(_QueryDialog): errormessage = "Not an integer." def getresult(self): return int(self.entry.get()) def askinteger(title, prompt, **kw): '''get an integer from the user Arguments: title -- the dialog title prompt -- the label text **kw -- see SimpleDialog class Return value is an integer ''' d = _QueryInteger(title, prompt, **kw) return d.result class _QueryFloat(_QueryDialog): errormessage = "Not a floating point value." def getresult(self): return float(self.entry.get()) def askfloat(title, prompt, **kw): '''get a float from the user Arguments: title -- the dialog title prompt -- the label text **kw -- see SimpleDialog class Return value is a float ''' d = _QueryFloat(title, prompt, **kw) return d.result class _QueryString(_QueryDialog): def __init__(self, *args, **kw): if "show" in kw: self.__show = kw["show"] del kw["show"] else: self.__show = None _QueryDialog.__init__(self, *args, **kw) def body(self, master): entry = _QueryDialog.body(self, master) if self.__show is not None: entry.configure(show=self.__show) return entry def getresult(self): return self.entry.get() def askstring(title, prompt, **kw): '''get a string from the user Arguments: title -- the dialog title prompt -- the label text **kw -- see SimpleDialog class Return value is a string ''' d = _QueryString(title, prompt, **kw) return d.result if __name__ == "__main__": root = Tk() root.update() print askinteger("Spam", "Egg count", initialvalue=12*12) print askfloat("Spam", "Egg weight\n(in tons)", minvalue=1, maxvalue=100) print askstring("Spam", "Egg label") PK,/1]HSimpleDialog.pycnu[ zfc@sFdZddlTdddYZedkrBdZendS( s'A simple but flexible modal dialog box.i(t*t SimpleDialogcBsVeZdgd d d d dZdddZdZdZdZdZRS( tc Cs|rt|d||_nt||_|rV|jj||jj|nt|jd|dd|_|jjdddtt|j|_ |j j||_ ||_ ||_ |jj d|jxtt|D]u}||} t|j d| d ||d } ||krI| jd td d n| jdtdtddqW|jjd|j|j|dS(Ntclass_ttexttaspectitexpanditfillstcommandcSs |j|S(N(tdone(tselftnum((s+/usr/lib64/python2.7/lib-tk/SimpleDialog.pytRtrelieft borderwidthitsidetWM_DELETE_WINDOW(tTopleveltrootttitleticonnametMessagetmessagetpacktBOTHtFrametframeR tcanceltdefaulttbindt return_eventtrangetlentButtontconfigtRIDGEtLEFTtprotocoltwm_delete_windowt_set_transient( R tmasterRtbuttonsRRRRR tstb((s+/usr/lib64/python2.7/lib-tk/SimpleDialog.pyt__init__ s.       g?g333333?c Csh|j}|j|j||j|jri|j}|j}|j}|j}n"|j }|j }d}}|j } |j } ||| |} ||| |} | | |j kr|j | } n| dkrd} n| | |j kr.|j | } n| dkrCd} n|j d| | f|jdS(Nis+%d+%d(Rtwithdrawt transienttupdate_idletaskstwinfo_ismappedt winfo_widtht winfo_heightt winfo_rootxt winfo_rootytwinfo_screenwidthtwinfo_screenheighttwinfo_reqwidthtwinfo_reqheighttgeometryt deiconify( R R(trelxtrelytwidgettm_widthtm_heighttm_xtm_ytw_widthtw_heighttxty((s+/usr/lib64/python2.7/lib-tk/SimpleDialog.pyR'%s4                 cCs;|jj|jj|jj|jj|jS(N(Rtwait_visibilitytgrab_settmainlooptdestroyR (R ((s+/usr/lib64/python2.7/lib-tk/SimpleDialog.pytgoBs     cCs3|jdkr|jjn|j|jdS(N(RtNoneRtbellR (R tevent((s+/usr/lib64/python2.7/lib-tk/SimpleDialog.pyRIscCs3|jdkr|jjn|j|jdS(N(RRKRRLR (R ((s+/usr/lib64/python2.7/lib-tk/SimpleDialog.pyR&OscCs||_|jjdS(N(R Rtquit(R R ((s+/usr/lib64/python2.7/lib-tk/SimpleDialog.pyR Us N( t__name__t __module__RKR,R'RJRR&R (((s+/usr/lib64/python2.7/lib-tk/SimpleDialog.pyRs    t__main__cCsjt}|d}t|ddd|}|jt|ddd|j}|j|jdS(Nc SsBt|ddddddgddd d d d }|jGHdS( NRsThis is a test dialog. Would this have been an actual dialog, the buttons below would have been glowing in soft pink light. Do you believe this?R)tYestNotCancelRiRiRs Test Dialog(RRJ(Rtd((s+/usr/lib64/python2.7/lib-tk/SimpleDialog.pytdoit^s  RtTestRtQuit(tTkR!RRNRH(RRVtttq((s+/usr/lib64/python2.7/lib-tk/SimpleDialog.pyttest\s    N((t__doc__tTkinterRROR\(((s+/usr/lib64/python2.7/lib-tk/SimpleDialog.pyts  S  PK,/1]t=))tkFileDialog.pycnu[ zfc@sddlmZdefdYZdefdYZdefdYZdefd YZd Zd Zd Zd dZ d dZ ddZ dZ e dkrdZddlZy5ddlZejejdejejZWneefk rnXeddgZyeed ZejWndGHejdGHnXdGejeGHeZdGejeGHndS(i(tDialogt_DialogcBseZdZdZRS(cCs6yt|jd|jd+s<          PK,/1]EF ,, FixTk.pycnu[ zfc@sbddlZddlZyddlZejjjWn eefk rWdZn XdZej j ej dZ ej j e sdZ ejdkrd Z nej j ej d e d Z ej je Z nej j e r^ee Z d ejkroxceje D]OZejdrej j e eZej jerheejd sB       !PK,/1]s tkFont.pycnu[ zfc@sdZddlZdZdZdZdZdZddd YZdd Z dd Z e d krej Z ed ddddeZejGHejd GHejdGHejGHejd GHejdGHe GHejdGejdGHejGHeddZejdGejdGHeje dddeZejeje ddde jZejededjZejdeejdeejndS(s0.9iNtnormaltromantboldtitaliccCstd|dtS(sFGiven the name of a tk named font, returns a Font representation. tnametexists(tFonttTrue(R((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt nametofontsRcBseZdZdZdZdZdddedZdZ dZ dZ dZ d Z d Zdd Zd Zd ZeZdZdZRS(sRepresents a named font. Constructor options are: font -- font specifier (name, system font, or (family, size, style)-tuple) name -- name to use for this font configuration (defaults to a unique name) exists -- does a named font by this name already exist? Creates a new named font if False, points to the existing font if True. Raises _Tkinter.TclError if the assertion is false. the following are ignored if font is specified: family -- font 'family', e.g. Courier, Times, Helvetica size -- font size in points weight -- font thickness: NORMAL, BOLD slant -- font slant: ROMAN, ITALIC underline -- font underlining: false (0), true (1) overstrike -- font strikeout: false (0), true (1) cCsig}xV|jD]H\}}t|ts=t|}n|jd||j|qWt|S(Nt-(titemst isinstancet basestringtstrtappendttuple(tselftkwtoptionstktv((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt_set/scCs2g}x|D]}|jd|q Wt|S(NR (RR(RtargsRR((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt_get8s cCsGi}x:tdt|dD] }||d|||dscKs=|stj}nt|d|}|rK|j|jdd|}n|j|}|sydtt|}n||_|rt |_ |j|j|jddkrtj j d|jfn|r|jdd|j|qn"|jdd|j|t |_ ||_|j|_|j|_dS(Nttktfonttactualtnamess$named font %s does not already existt configuretcreate(tTkintert _default_roottgetattrt splitlisttcallRR tidRtFalset delete_fontt_tkintertTclErrorRt_tkt_splitt_call(RtrootRRRRR((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt__init__Ds( !  $   cCs|jS(N(R(R((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt__str__ascCst|to|j|jkS(N(R RR(Rtother((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt__eq__dscCs |j|S(N(tcget(Rtkey((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt __getitem__gscCs|ji||6dS(N(R (RR5tvalue((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt __setitem__jscCsWy&|jr%|jdd|jnWn*ttfk rBntk rRnXdS(NRtdelete(R)R.RtKeyboardInterruptt SystemExitt Exception(R((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt__del__ms  cCst|j|jS(s*Return a distinct copy of the current font(RR,R(R((s%/usr/lib64/python2.7/lib-tk/tkFont.pytcopyvscCsO|r#|jdd|jd|S|j|j|jdd|jSdS(sReturn actual font attributesRRR N(R.RRR-(Rtoption((s%/usr/lib64/python2.7/lib-tk/tkFont.pyRzscCs|jdd|jd|S(sGet font attributeRtconfigR (R.R(RR?((s%/usr/lib64/python2.7/lib-tk/tkFont.pyR4scKsW|r+|jdd|j|j|n(|j|j|jdd|jSdS(sModify font attributesRR@N(R.RRRR-(RR((s%/usr/lib64/python2.7/lib-tk/tkFont.pyR@s cCst|jdd|j|S(sReturn text widthRtmeasure(tintR.R(Rttext((s%/usr/lib64/python2.7/lib-tk/tkFont.pyRAscGs|r.t|jdd|j|j|S|j|jdd|j}i}x@tdt|dD]&}t||d|||dRR4R@R RARD(((s%/usr/lib64/python2.7/lib-tk/tkFont.pyRs"          cCs1|stj}n|jj|jjddS(sGet font families (as a tuple)Rtfamilies(R"R#RR%R&(R/((s%/usr/lib64/python2.7/lib-tk/tkFont.pyRJs cCs1|stj}n|jj|jjddS(s'Get names of defined fonts (as a tuple)RR(R"R#RR%R&(R/((s%/usr/lib64/python2.7/lib-tk/tkFont.pyRs t__main__tfamilyttimestsizeitweightthellot linespaceRtCourieriRCs Hello, worldsQuit!tcommand((RRiR(t __version__R"tNORMALtROMANtBOLDtITALICRRRIRJRRFtTkR/tfRR@R4RARDtLabeltwtpacktButtontdestroyR>tfbtmainloop(((s%/usr/lib64/python2.7/lib-tk/tkFont.pyt s>          PK,/1]Z}22 Tkdnd.pyonu[ zfc@swdZddlZdZdd dYZdd dYZddd YZd Zed krsendS(sFDrag-and-drop support for Tkinter. This is very preliminary. I currently only support dnd *within* one application, between different windows (or within the same window). I am trying to make this as generic as possible -- not dependent on the use of a particular widget or icon type, etc. I also hope that this will work with Pmw. To enable an object to be dragged, you must create an event binding for it that starts the drag-and-drop process. Typically, you should bind to a callback function that you write. The function should call Tkdnd.dnd_start(source, event), where 'source' is the object to be dragged, and 'event' is the event that invoked the call (the argument to your callback function). Even though this is a class instantiation, the returned instance should not be stored -- it will be kept alive automatically for the duration of the drag-and-drop. When a drag-and-drop is already in process for the Tk interpreter, the call is *ignored*; this normally averts starting multiple simultaneous dnd processes, e.g. because different button callbacks all dnd_start(). The object is *not* necessarily a widget -- it can be any application-specific object that is meaningful to potential drag-and-drop targets. Potential drag-and-drop targets are discovered as follows. Whenever the mouse moves, and at the start and end of a drag-and-drop move, the Tk widget directly under the mouse is inspected. This is the target widget (not to be confused with the target object, yet to be determined). If there is no target widget, there is no dnd target object. If there is a target widget, and it has an attribute dnd_accept, this should be a function (or any callable object). The function is called as dnd_accept(source, event), where 'source' is the object being dragged (the object passed to dnd_start() above), and 'event' is the most recent event object (generally a event; it can also be or ). If the dnd_accept() function returns something other than None, this is the new dnd target object. If dnd_accept() returns None, or if the target widget has no dnd_accept attribute, the target widget's parent is considered as the target widget, and the search for a target object is repeated from there. If necessary, the search is repeated all the way up to the root widget. If none of the target widgets can produce a target object, there is no target object (the target object is None). The target object thus produced, if any, is called the new target object. It is compared with the old target object (or None, if there was no old target widget). There are several cases ('source' is the source object, and 'event' is the most recent event object): - Both the old and new target objects are None. Nothing happens. - The old and new target objects are the same object. Its method dnd_motion(source, event) is called. - The old target object was None, and the new target object is not None. The new target object's method dnd_enter(source, event) is called. - The new target object is None, and the old target object is not None. The old target object's method dnd_leave(source, event) is called. - The old and new target objects differ and neither is None. The old target object's method dnd_leave(source, event), and then the new target object's method dnd_enter(source, event) is called. Once this is done, the new target object replaces the old one, and the Tk mainloop proceeds. The return value of the methods mentioned above is ignored; if they raise an exception, the normal exception handling mechanisms take over. The drag-and-drop processes can end in two ways: a final target object is selected, or no final target object is selected. When a final target object is selected, it will always have been notified of the potential drop by a call to its dnd_enter() method, as described above, and possibly one or more calls to its dnd_motion() method; its dnd_leave() method has not been called since the last call to dnd_enter(). The target is notified of the drop by a call to its method dnd_commit(source, event). If no final target object is selected, and there was an old target object, its dnd_leave(source, event) method is called to complete the dnd sequence. Finally, the source object is notified that the drag-and-drop process is over, by a call to source.dnd_end(target, event), specifying either the selected target object, or None if no target object was selected. The source object can use this to implement the commit action; this is sometimes simpler than to do it in the target's dnd_commit(). The target's dnd_commit() method could then simply be aliased to dnd_leave(). At any time during a dnd sequence, the application can cancel the sequence by calling the cancel() method on the object returned by dnd_start(). This will call dnd_leave() if a target is currently active; it will never call dnd_commit(). iNcCs$t||}|jr|SdSdS(N(t DndHandlertroottNone(tsourceteventth((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyt dnd_startls RcBsJeZdZdZdZdZdZddZddZ RS(cCs|jdkrdS|jj}y|jdSWn#tk rV||_||_nX||_d|_|j|_ }|j|_ }d||f|_ |dpd|_ |j |j |j|j d|jd|dtcursortsthand2(tnumtwidgett_roott_DndHandler__dndtAttributeErrorRRRttargettinitial_buttontinitial_widgettrelease_patternt save_cursortbindt on_releaset on_motion(tselfRRRtbuttonR ((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyt__init__zs$     cCs=|j}d|_|r9y |`Wq9tk r5q9XndS(N(RRR R(RR((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyt__del__s    c Cs|j|j}}|jj||}|j}d}xM|ry |j}Wntk r`nX|||}|rzPn|j}q:W|j }||kr|r|j ||qnD|rd|_ |j ||n|r|j ||||_ ndS(N( tx_rootty_rootRtwinfo_containingRRt dnd_acceptRtmasterRt dnd_motiont dnd_leavet dnd_enter( RRtxtyt target_widgetRt new_targettattrt old_target((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyRs.        cCs|j|ddS(Ni(tfinish(RR((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyRscCs|j|ddS(Ni(R)(RR((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pytcancelsicCs|j}|j}|j}|j}z|`|jj|j|jjd|j|dR( RRRRR tunbindRRRt dnd_commitR!tdnd_end(RRtcommitRRR R((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyR)s     N( t__name__t __module__RRRRRRR*R)(((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyRvs    tIconcBsVeZdZdddZdZdZdZdZdZdZ RS( cCs$||_d|_|_|_dS(N(tnameRtcanvastlabeltid(RR2((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyRs i cCs||jkr,|jj|j||dS|jrB|jn|sLdStj|d|jdddd}|j||d|dd}||_||_||_|j d |j dS( Nttextt borderwidthitrelieftraisedtwindowtanchortnws ( R3tcoordsR5tdetachtTkintertLabelR2t create_windowR4Rtpress(RR3R#R$R4R5((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pytattachs     cCsW|j}|sdS|j}|j}d|_|_|_|j||jdS(N(R3R5R4Rtdeletetdestroy(RR3R5R4((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyR>s    cCsOt||rK|j|_|j|_|jj|j\|_|_ ndS(N( RR#tx_offR$ty_offR3R=R5tx_origty_orig(RR((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyRBs  cCs8|j|j|\}}|jj|j||dS(N(twhereR3R=R5(RRR#R$((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pytmovescCs#|jj|j|j|jdS(N(R3R=R5RHRI(R((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pytputbackscCsJ|j}|j}|j|}|j|}||j||jfS(N(t winfo_rootxt winfo_rootyRRRFRG(RR3Rtx_orgty_orgR#R$((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyRJs     cCsdS(N((RRR((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyR- s( R/R0RRCR>RBRKRLRJR-(((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyR1s     tTestercBs>eZdZdZdZdZdZdZRS(cCs_tj||_tj|jdddd|_|jjdddd|j|j_dS(Ntwidthidtheighttfilltbothtexpandi(R?tToplevelttoptCanvasR3tpackR(RR((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyRs!cCs|S(N((RRR((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyRsc Cs|jj|j|j|\}}|jj|j\}}}}||||} } |jj|||| || |_|j||dS(N(R3t focus_setRJtbboxR5tcreate_rectangletdndidR ( RRRR#R$tx1ty1tx2ty2tdxtdy((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyR"s  !&c Csa|j|j|\}}|jj|j\}}}}|jj|j||||dS(N(RJR3R\R^RK( RRRR#R$R_R`RaRb((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyR s!cCs-|jj|jj|jd|_dS(N(RXR[R3RDR^R(RRR((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyR!$s cCsE|j|||j|j|\}}|j|j||dS(N(R!RJR3RC(RRRR#R$((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyR,)s(R/R0RRR"R R!R,(((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyRQ s      cCstj}|jdtjd|jddjt|}|jjdt|}|jjdt|}|jjdtd}td }td }|j |j |j |j |j |j |j dS( Ns+1+1tcommandR6tQuits+1+60s+120+60s+240+60tICON1tICON2tICON3( R?tTktgeometrytButtontquitRZRQRXR1RCR3tmainloop(Rtt1tt2tt3ti1ti2ti3((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pyttest.s         t__main__((((t__doc__R?RRR1RQRuR/(((s$/usr/lib64/python2.7/lib-tk/Tkdnd.pytds  Z<"  PK,/1]ck66tkMessageBox.pycnu[ zfc@sddlmZdZdZdZdZdZdZdZd Z d Z d Z d Z d Z dZdZdZdZdZdefdYZd+d+d+d+dZd+d+dZd+d+dZd+d+dZd+d+dZd+d+dZd+d+dZd+d+dZd+d+dZedkrdGeddGHdGedd GHdGedd!GHdGedd"GHd#Gedd$GHd%Gedd&GHd'Gedd(GHd)Gedd*GHnd+S(,i(tDialogterrortinfotquestiontwarningtabortretryignoretoktokcancelt retrycanceltyesnot yesnocanceltaborttretrytignoretcanceltyestnotMessagecBseZdZdZRS(s A message boxt tk_messageBox(t__name__t __module__t__doc__tcommand(((s+/usr/lib64/python2.7/lib-tk/tkMessageBox.pyR9scKs|rd|kr||dd|kr>||dt||tt|}t|}|tkr4dS|tkS(sDAsk a question; return true if the answer is yes, None if cancelled.N(R%R-t YESNOCANCELR tCANCELtNoneR(RRR#R1((s+/usr/lib64/python2.7/lib-tk/tkMessageBox.pytaskyesnocancelks   cKs"t||tt|}|tkS(sDAsk if operation should be retried; return true if the answer is yes(R%R)t RETRYCANCELtRETRY(RRR#R1((s+/usr/lib64/python2.7/lib-tk/tkMessageBox.pytaskretrycanceltst__main__tSpamsEgg Informations Egg Warnings Egg Alerts Question?tproceedsProceed?syes/nosGot it?s yes/no/cancelsWant it?s try agains Try again?N(ttkCommonDialogRR+R&R-R)tABORTRETRYIGNORER'R0R8R.R4tABORTR9tIGNORER5RRRR6R%R(R*R,R/R2R3R7R:R(((s+/usr/lib64/python2.7/lib-tk/tkMessageBox.pytsH   PK,/1]3VZwZwTix.pycnu[ 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