diff -r d57df3f72715 Lib/idlelib/configDialog.py --- a/Lib/idlelib/configDialog.py Thu Feb 20 20:53:27 2014 -0500 +++ b/Lib/idlelib/configDialog.py Sun Feb 23 01:18:59 2014 +0530 @@ -14,6 +14,8 @@ import tkinter.colorchooser as tkColorChooser import tkinter.font as tkFont import copy +import os +import re from idlelib.configHandler import idleConf from idlelib.dynOptionMenuWidget import DynOptionMenu @@ -21,6 +23,7 @@ from idlelib.keybindingDialog import GetKeysDialog from idlelib.configSectionNameDialog import GetCfgSectionNameDialog from idlelib.configHelpSourceEdit import GetHelpSourceDialog +from idlelib import textView from idlelib import macosxSupport class ConfigDialog(Toplevel): @@ -61,7 +64,7 @@ #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.bind('',self.Help) #context help self.LoadConfigs() self.AttachVarCallbacks() #avoid callbacks during LoadConfigs @@ -82,10 +85,9 @@ else: extraKwds=dict(padx=6, pady=3) -# Comment out button creation and packing until implement self.Help -## self.buttonHelp = Button(frameActionButtons,text='Help', -## command=self.Help,takefocus=FALSE, -## **extraKwds) + self.buttonHelp = Button(frameActionButtons,text='Help', + command=self.Help,takefocus=FALSE, + **extraKwds) self.buttonOk = Button(frameActionButtons,text='Ok', command=self.Ok,takefocus=FALSE, **extraKwds) @@ -99,7 +101,7 @@ self.CreatePageHighlight() self.CreatePageKeys() self.CreatePageGeneral() -## self.buttonHelp.pack(side=RIGHT,padx=5) + self.buttonHelp.pack(side=RIGHT,padx=5) self.buttonOk.pack(side=LEFT,padx=5) self.buttonApply.pack(side=LEFT,padx=5) self.buttonCancel.pack(side=LEFT,padx=5) @@ -1137,7 +1139,18 @@ self.ActivateConfigChanges() def Help(self): - pass + fn = os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt') + try: + with open(fn, 'r', encoding=None) as file: + contents = file.read() + except OSError: + import tkinter.messagebox as tkMessageBox + tkMessageBox.showerror(title='File Load Error', + message='Unable to load file %r .' % fn, + parent=parent) + config_helptext = re.search(r'(Options Menu)(.*?)(?=Code Context)',contents, re.DOTALL|re.MULTILINE).group(0) + help_dialog = textView.TextViewer(self,"IDLE Config Help Dialog" , config_helptext ) + if __name__ == '__main__': #test the dialog diff -r d57df3f72715 Lib/idlelib/help.txt --- a/Lib/idlelib/help.txt Thu Feb 20 20:53:27 2014 -0500 +++ b/Lib/idlelib/help.txt Sun Feb 23 01:18:59 2014 +0530 @@ -126,10 +126,47 @@ Options Menu (Shell and Editor): - Configure IDLE -- Open a configuration dialog. Fonts, indentation, - keybindings, and color themes may be altered. - Startup Preferences may be set, and additional Help - sources can be specified. + Configure IDLE -- Open a configuration dialog for IDLE.It has tabs + to adjust fonts , highlighting , keyset and general + preferences. + + Fonts/Tabs -- The Fonts/Tabs tabbed window lets you + select your font face,font size, and + the default indentation width.The + default indentation width in Python + is 4 spaces . More information is + available about Python's tab + indentation + standard's at http://legacy.python.org/ + dev/peps/pep-0008/ + + Highlighting -- This tab is used to configure the + visual aspects of your IDLE + experience.You can choose colors for + different symbols in Python like + keywords,definitions , comments etc. + You may choose to use the default + IDLE theme, + or save and use your own custom + theme. + + Keys -- The Keys tab lets you define key + bindings and shortcuts for + the common actions.You may choose + the built-in keyset's from OSX, + Unix, Windows and Mac, or choose to + your own customised keyset. + + General -- The general tab contains options to + modify startup preferences, autosave + preferences,initial window size , + paragraph reformat width. You can + also add additional help sources to + IDLE or reconfigure existing ones. + + + + --- Code Context (toggle) -- Open a pane at the top of the edit window