ó zfc@sFdZddlTddd„ƒYZedkrBd„ZeƒndS( s'A simple but flexible modal dialog box.iÿÿÿÿ(t*t SimpleDialogcBsVeZdgd d d d d„Zddd„Zd„Zd„Zd„Zd„ZRS( tc Cs|rt|d|ƒ|_nt|ƒ|_|rV|jj|ƒ|jj|ƒnt|jd|ddƒ|_|jjdddtƒt|jƒ|_ |j jƒ||_ ||_ ||_ |jj d|jƒx‰tt|ƒƒD]u}||} t|j d| d ||d „ƒ} ||krI| jd td d ƒn| jdtdtddƒqðW|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ƒ|jƒri|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ƒ|jƒdS(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|jjƒn|j|jƒdS(N(RtNoneRtbellR (R tevent((s+/usr/lib64/python2.7/lib-tk/SimpleDialog.pyRIscCs3|jdkr|jjƒn|j|jƒdS(N(RRKRRLR (R ((s+/usr/lib64/python2.7/lib-tk/SimpleDialog.pyR&OscCs||_|jjƒdS(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|ƒ}|jƒt|ddd|jƒ}|jƒ|jƒdS(Nc SsBt|ddddddgddd d d d ƒ}|jƒGHdS( NRs‘This 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