%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/lib-tk/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyo

ó
Mêáac@sûdZddlTdefd„ƒYZdefd„ƒYZdefd„ƒYZd	„Zd
efd„ƒYZd„Zd
efd„ƒYZ	d„Z
edkr÷eƒZ
e
jƒeddddƒGHeddddddƒGHe
ddƒGHndS(sú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
iÿÿÿÿ(t*tDialogcBs_eZdZd	d„Zd„Zd„Zd„Zd	d„Zd	d„Z	d„Z
d„ZRS(
sZClass to open dialogs.

    This class is intended as a base class for custom dialogs
    cCs=tj||ƒ|jƒ|jƒr6|j|ƒn|rL|j|ƒn||_d|_t	|ƒ}|j
|ƒ|_|jddddƒ|j
ƒ|js±||_n|jd|jƒ|jdk	r|jd|jƒd|jƒdfƒn|jƒ|jjƒ|jƒ|jƒ|j|ƒdS(s˜Initialize 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((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyR%s.

		
	



cCsd|_tj|ƒdS(sDestroy the windowN(RRRtdestroy(R((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyRXs	cCsdS(s«create dialog body.

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

        override if you do not want the standard buttons
        ttexttOKtwidthi
tcommandtdefaulttsideRiRtCancels<Return>s<Escape>N(RtButtontoktACTIVERtLEFTRtbind(Rtboxtw((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyRis'!cCsQ|jƒs|jjƒdS|jƒ|jƒz|jƒWd|jƒXdS(N(tvalidateRRRtupdate_idletaskstapplyR(Rtevent((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyR(~s


cCs-|jdk	r|jjƒn|jƒdS(N(RRRR(RR1((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyRŒscCsdS(s¨validate the data

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

        This method is called automatically to process the data, *after*
        the dialog is destroyed. By default, it does nothing.
        N((R((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyR0ŸsN(t__name__t
__module__t__doc__RRRRRR(RR.R0(((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyRs3				
		t_QueryDialogcBs8eZddddd„Zd„Zd„Zd„ZRS(cCsY|sddl}|j}n||_||_||_||_tj|||ƒdS(Niÿÿÿÿ(tTkintert
_default_roottprompttminvaluetmaxvaluetinitialvalueRR(RR
R8R;R9R:RR6((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyR®s				cCsd|_tj|ƒdS(N(RtentryRR(R((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyR¿s	cCs±t|d|jdtƒ}|jdddddtƒt|dd	ƒ|_|jjdd
dddttƒ|jdk	rª|jj
d|jƒ|jjdtƒn|jS(NR tjustifytrowiRitstickytnameR<i(
tLabelR8R*tgridtWtEntryR<tER;Rtinserttselect_rangetEND(RRR-((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyRÃs#cCsÙddl}y|jƒ}Wn/tk
rM|jd|jdd|ƒdSX|jdk	r||jkr|jdd|jd|ƒdS|jdk	rÌ||jkrÌ|jdd	|jd|ƒdS||_d
S(Niÿÿÿÿs
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
((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyR.Ñs2



	N(R2R3RRRRR.(((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyR5¬s		t
_QueryIntegercBseZdZd„ZRS(sNot an integer.cCst|jjƒƒS(N(tintR<tget(R((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyRJøs(R2R3RMRJ(((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyRNöscKst|||}|jS(s¼get 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((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyt
askintegerûst_QueryFloatcBseZdZd„ZRS(sNot a floating point value.cCst|jjƒƒS(N(tfloatR<RP(R((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyRJs(R2R3RMRJ(((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyRT	scKst|||}|jS(s¶get 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((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pytaskfloatst_QueryStringcBs#eZd„Zd„Zd„ZRS(cOsCd|kr#|d|_|d=n	d|_tj|||ŽdS(Ntshow(t_QueryString__showRR5R(RtargsRQ((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyRs


	cCs;tj||ƒ}|jdk	r7|jd|jƒn|S(NRX(R5RRYRt	configure(RRR<((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyR%scCs
|jjƒS(N(R<RP(R((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyRJ+s(R2R3RRRJ(((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyRWs		cKst|||}|jS(s¸get 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((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyt	askstring.st__main__tSpams	Egg countR;isEgg weight
(in tons)R9iR:ids	Egg labelNi(R4R6RRR5RNRSRTRVRWR\R2tTktroottupdate(((s1/usr/local/lib/python2.7/lib-tk/tkSimpleDialog.pyt<module>s
ŽJ				


Zerion Mini Shell 1.0