--- /Users/kevin/Python-2.7.3/Lib/idlelib/configDialog.py 2012-04-09 19:07:30.000000000 -0400 +++ /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/idlelib/configDialog.py 2012-10-11 23:03:53.000000000 -0400 @@ -26,7 +26,7 @@ def __init__(self,parent,title): Toplevel.__init__(self, parent) self.wm_withdraw() - + self.configure(borderwidth=5) self.title('IDLE Preferences') self.geometry("+%d+%d" % (parent.winfo_rootx()+20, @@ -56,10 +56,11 @@ self.protocol("WM_DELETE_WINDOW", self.Cancel) self.parent = parent self.tabPages.focus_set() - #key bindings for this dialog - #self.bind('',self.Cancel) #dismiss dialog, no save - #self.bind('',self.Apply) #apply changes, save - #self.bind('',self.Help) #context help +# #key bindings for this dialog +# #self.bind('',self.Cancel) #dismiss dialog, no save +# #self.bind('',self.Apply) #apply changes, save +# #self.bind('',self.Help) #context help + self.LoadConfigs() self.AttachVarCallbacks() #avoid callbacks during LoadConfigs @@ -827,14 +828,15 @@ self.SetFontSample() def SetFontSample(self,event=None): - fontName=self.fontName.get() - if self.fontBold.get(): - fontWeight=tkFont.BOLD - else: - fontWeight=tkFont.NORMAL - self.editFont.config(size=self.fontSize.get(), - weight=fontWeight,family=fontName) - + fontName=self.fontName.get() + if self.fontBold.get(): + fontWeight=tkFont.BOLD + else: + fontWeight=tkFont.NORMAL + ###workaround for crash on Tk-Cocoa + newFont = (fontName, self.fontSize.get(), fontWeight) + self.labelFontSample.config(font = newFont) + def SetHighlightTarget(self): if self.highlightTarget.get()=='Cursor': #bg not possible self.radioFg.config(state=DISABLED) @@ -933,25 +935,25 @@ fonts=list(tkFont.families(self)) fonts.sort() for font in fonts: - self.listFontName.insert(END,font) + self.listFontName.insert(END,font) configuredFont=idleConf.GetOption('main','EditorWindow','font', - default='courier') + default='courier') lc_configuredFont = configuredFont.lower() self.fontName.set(lc_configuredFont) lc_fonts = [s.lower() for s in fonts] if lc_configuredFont in lc_fonts: - currentFontIndex = lc_fonts.index(lc_configuredFont) - self.listFontName.see(currentFontIndex) - self.listFontName.select_set(currentFontIndex) - self.listFontName.select_anchor(currentFontIndex) + currentFontIndex = lc_fonts.index(lc_configuredFont) + self.listFontName.see(currentFontIndex) + self.listFontName.select_set(currentFontIndex) + self.listFontName.select_anchor(currentFontIndex) ##font size dropdown fontSize=idleConf.GetOption('main','EditorWindow','font-size', - default='10') + default='10') self.optMenuFontSize.SetMenu(('7','8','9','10','11','12','13','14', - '16','18','20','22'),fontSize ) + '16','18','20','22'),fontSize ) ##fontWeight self.fontBold.set(idleConf.GetOption('main','EditorWindow', - 'font-bold',default=0,type='bool')) + 'font-bold',default=0,type='bool')) ##font sample self.SetFontSample() @@ -1060,6 +1062,7 @@ ### general page self.LoadGeneralCfg() + def SaveNewKeySet(self,keySetName,keySet): """ save a newly created core key set.