Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/lib-tk/
Upload File :
Current File : //usr/lib/python2.7/lib-tk/tkSimpleDialog.pyc


|_c@sdZddlTdefdYZdefdYZdefdYZd	Zd
efdYZdZd
efdYZ	dZ
edkreZ
e
jeddddGHeddddddGHe
ddGHndS(sDialog 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
i(t*tDialogcBs_eZdZd	dZdZdZdZd	dZd	dZ	dZ
dZRS(
sZClass to open dialogs.

    This class is intended as a base class for custom dialogs
    cCs=tj|||j|jr6|j|n|rL|j|n||_d|_t	|}|j
||_|jdddd|j
|js||_n|jd|j|jdk	r|jd|jd|jdfn|j|jj|j|j|j|dS(sInitialize a dialog.

        Arguments:

            parent -- a parent window (the application window)

            title -- the dialog title
        tpadxitpadytWM_DELETE_WINDOWs+%d+%di2N(tToplevelt__init__twithdrawtwinfo_viewablet	transientttitletparenttNonetresulttFrametbodyt
initial_focustpackt	buttonboxtprotocoltcanceltgeometrytwinfo_rootxtwinfo_rootyt	deiconifyt	focus_settwait_visibilitytgrab_settwait_window(tselfRR
R((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyR%s.

		
	



cCsd|_tj|dS(sDestroy the windowN(RRRtdestroy(R((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRXs	cCsdS(screate dialog body.

        return widget that should have initial focus.
        This method should be overridden, and is called
        by the __init__ method.
        N((Rtmaster((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyR`sc
Cst|}t|ddddd|jdt}|jdtdd	d
d	t|ddddd|j}|jdtdd	d
d	|jd|j|jd
|j|jdS(s[add standard button box.

        override if you do not want the standard buttons
        ttexttOKtwidthi
tcommandtdefaulttsideRiRtCancels<Return>s<Escape>N(RtButtontoktACTIVERtLEFTRtbind(Rtboxtw((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRis'!cCsQ|js|jjdS|j|jz|jWd|jXdS(N(tvalidateRRRtupdate_idletaskstapplyR(Rtevent((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyR(~s


cCs-|jdk	r|jjn|jdS(N(RRRR(RR1((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRscCsdS(svalidate the data

        This method is called automatically to validate the data before the
        dialog is destroyed. By default, it always validates OK.
        i((R((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyR.scCsdS(sprocess the data

        This method is called automatically to process the data, *after*
        the dialog is destroyed. By default, it does nothing.
        N((R((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyR0sN(t__name__t
__module__t__doc__RRRRRR(RR.R0(((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRs3				
		t_QueryDialogcBs8eZdddddZdZdZdZRS(cCsY|sddl}|j}n||_||_||_||_tj|||dS(Ni(tTkintert
_default_roottprompttminvaluetmaxvaluetinitialvalueRR(RR
R8R;R9R:RR6((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRs				cCsd|_tj|dS(N(RtentryRR(R((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRs	cCst|d|jdt}|jdddddtt|dd	|_|jjdd
dddtt|jr|jj	d|j|jj
dtn|jS(NR tjustifytrowiRitstickytnameR<i(tLabelR8R*tgridtWtEntryR<tER;tinserttselect_rangetEND(RRR-((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRs#	cCsddl}y|j}Wn/tk
rM|jd|jdd|dSX|jdk	r||jkr|jdd|jd|dS|jdk	r||jkr|jdd	|jd|dS||_d
S(Nis
Illegal values
Please try againRis	Too smalls2The allowed minimum value is %s. Please try again.s	Too larges2The allowed maximum value is %s. Please try again.i(	ttkMessageBoxt	getresultt
ValueErrortshowwarningterrormessageR9RR:R
(RRIR
((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyR.s2



	N(R2R3RRRRR.(((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyR5s		t
_QueryIntegercBseZdZdZRS(sNot an integer.cCst|jjS(N(tintR<tget(R((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRJs(R2R3RMRJ(((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRNscKst|||}|jS(sget an integer from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is an integer
    (RNR
(R
R8tkwtd((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyt
askintegerst_QueryFloatcBseZdZdZRS(sNot a floating point value.cCst|jjS(N(tfloatR<RP(R((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRJs(R2R3RMRJ(((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRT	scKst|||}|jS(sget a float from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is a float
    (RTR
(R
R8RQRR((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pytaskfloatst_QueryStringcBs#eZdZdZdZRS(cOsCd|kr#|d|_|d=n	d|_tj|||dS(Ntshow(t_QueryString__showRR5R(RtargsRQ((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRs


	cCs;tj||}|jdk	r7|jd|jn|S(NRX(R5RRYRt	configure(RRR<((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyR%scCs
|jjS(N(R<RP(R((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRJ+s(R2R3RRRJ(((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyRWs		cKst|||}|jS(sget a string from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is a string
    (RWR
(R
R8RQRR((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyt	askstring.st__main__tSpams	Egg countR;isEgg weight
(in tons)R9iR:ids	Egg labelNi(R4R6RRR5RNRSRTRVRWR\R2tTktroottupdate(((s+/usr/lib/python2.7/lib-tk/tkSimpleDialog.pyt<module>s
J