ó tŪļQc@s}dZddlTddlZdefd„ƒYZedkryeƒZd„Ze edd d eƒj ƒej ƒndS( s~ Dialog that allows user to specify a new config file section name. Used to get new highlight theme and keybinding set names. iĸĸĸĸ(t*NtGetCfgSectionNameDialogcBs;eZd„Zd„Zd„Zdd„Zdd„ZRS(cCs>tj||ƒ|jddƒ|jdtdtƒ|j|ƒ|j|ƒ|jƒ|jd|j ƒ||_ ||_ ||_ d|_ |jƒ|jƒ|jƒ|jjd|jjƒƒ|jd|jƒ|jƒd|jƒd|jƒ|jƒd|jƒdfƒ|jƒ|jƒd S( sŽ message - string, informational message to display usedNames - list, list of names already in use for validity check t borderwidthitheighttwidthtWM_DELETE_WINDOWts+%d+%diN(tToplevelt__init__t configuret resizabletFALSEttitlet transienttgrab_settprotocoltCanceltparenttmessaget usedNamestresultt CreateWidgetstwithdrawtupdate_idletaskst messageInfotconfigt frameMaintwinfo_reqwidthtgeometryt winfo_rootxt winfo_widtht winfo_rootyt winfo_heighttwinfo_reqheightt deiconifyt wait_window(tselfRR RR((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pyR s,            c Csšt|ƒ|_t|ƒ|_t|dddtƒ|_|jjdtdtdt ƒt |jdt dt d d d d d |j ƒ|_t|jd |jddƒ}|jƒ|jjd d d d ƒ|jd d d d ƒt|ƒ}|jdtdtƒt|d dddd|jƒ|_|jjddddd d d d ƒt|d dddd|jƒ|_|jjddddd d d d ƒdS(NRitrelieftsidetexpandtfilltanchortjustifytpadxitpadyttextt textvariableRitOkitcommandtrowitcolumnRi(t StringVartnametfontSizetFrametSUNKENRtpacktTOPtTRUEtBOTHtMessagetWtLEFTRRtEntryt focus_settBOTTOMtXtButtonR/tbuttonOktgridRt buttonCancel(R$t entryNamet frameButtons((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pyR&s$$  %cCs―d}|jjƒ}|jƒ|sJtjddddd|ƒd}not|ƒdkr…tjdddd d d|ƒd}n4||jkrđtjdddd d|ƒd}n|S( NiR s Name ErrorRsNo name specified.Riis)Name too long. It should be no more than s30 characters.sThis name is already in use.(R4tgettstript tkMessageBoxt showerrortlenR(R$tnameOkR4((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pytNameOk:s"      cCs5|jƒr1|jjƒjƒ|_|jƒndS(N(ROR4RIRJRtdestroy(R$tevent((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pyR/Os cCsd|_|jƒdS(NR(RRP(R$RQ((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pyRTs N(t__name__t __module__RRROtNoneR/R(((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pyRs     t__main__cCs$d}ttddƒ}|jGHdS(NRsGet Names:The information here should need to be word wrapped. Test.(RtrootR(tkeySeqtdlg((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pytrun[s  R-tDialogR0( t__doc__tTkinterRKRRRRtTkRVRYRCR8tmainloop(((s5/sys/lib/python2.7/idlelib/configSectionNameDialog.pyts  P