Index: Lib/idlelib/config-main.def =================================================================== --- Lib/idlelib/config-main.def (revision 70642) +++ Lib/idlelib/config-main.def (working copy) @@ -57,6 +57,7 @@ font-size= 10 font-bold= 0 encoding= none +cursor-blink = 0 [FormatParagraph] paragraph=70 Index: Lib/idlelib/configDialog.py =================================================================== --- Lib/idlelib/configDialog.py (revision 70642) +++ Lib/idlelib/configDialog.py (working copy) @@ -332,6 +332,7 @@ self.encoding=StringVar(self) self.userHelpBrowser=BooleanVar(self) self.helpBrowser=StringVar(self) + self.cursorBlink = BooleanVar(self) #widget creation #body frame=self.tabPages.pages['General'].frame @@ -343,6 +344,7 @@ frameWinSize=Frame(frame,borderwidth=2,relief=GROOVE) frameParaSize=Frame(frame,borderwidth=2,relief=GROOVE) frameEncoding=Frame(frame,borderwidth=2,relief=GROOVE) + frameCursorBlink = Frame(frame, borderwidth=2, relief=GROOVE) frameHelp=LabelFrame(frame,borderwidth=2,relief=GROOVE, text=' Additional Help Sources ') #frameRun @@ -379,6 +381,12 @@ value="utf-8",text="UTF-8") radioEncNone=Radiobutton(frameEncoding,variable=self.encoding, value="none",text="None") + # frameCursorBlink + labelCursorBlink = Label(frameCursorBlink, text="Cursor blink") + radioCursorBlink = Radiobutton(frameCursorBlink, + variable=self.cursorBlink, value=True, text="Blink") + radioCursorNoBlink = Radiobutton(frameCursorBlink, + variable=self.cursorBlink, value=False, text="No blink") #frameHelp frameHelpList=Frame(frameHelp) frameHelpListButtons=Frame(frameHelpList) @@ -401,6 +409,7 @@ frameWinSize.pack(side=TOP,padx=5,pady=5,fill=X) frameParaSize.pack(side=TOP,padx=5,pady=5,fill=X) frameEncoding.pack(side=TOP,padx=5,pady=5,fill=X) + frameCursorBlink.pack(side=TOP, padx=5, pady=5, fill=X) frameHelp.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH) #frameRun labelRunChoiceTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) @@ -424,6 +433,10 @@ radioEncNone.pack(side=RIGHT,anchor=E,pady=5) radioEncUTF8.pack(side=RIGHT,anchor=E,pady=5) radioEncLocale.pack(side=RIGHT,anchor=E,pady=5) + # frameCursorBlink + labelCursorBlink.pack(side=LEFT, anchor=W, padx=5, pady=5) + radioCursorBlink.pack(side=RIGHT, anchor=E, pady=5) + radioCursorNoBlink.pack(side=RIGHT, anchor=E, pady=5) #frameHelp frameHelpListButtons.pack(side=RIGHT,padx=5,pady=5,fill=Y) frameHelpList.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH) @@ -454,6 +467,7 @@ self.startupEdit.trace_variable('w',self.VarChanged_startupEdit) self.autoSave.trace_variable('w',self.VarChanged_autoSave) self.encoding.trace_variable('w',self.VarChanged_encoding) + self.cursorBlink.trace_variable('w', self.VarChanged_cursorBlink) def VarChanged_fontSize(self,*params): value=self.fontSize.get() @@ -551,6 +565,10 @@ value=self.encoding.get() self.AddChangedItem('main','EditorWindow','encoding',value) + def VarChanged_cursorBlink(self, *params): + value = self.cursorBlink.get() + self.AddChangedItem('main', 'EditorWindow', 'cursor-blink', value) + def ResetChangedItems(self): #When any config item is changed in this dialog, an entry #should be made in the relevant section (config type) of this @@ -1043,6 +1061,9 @@ # default source encoding self.encoding.set(idleConf.GetOption('main', 'EditorWindow', 'encoding', default='none')) + # cursor blink + self.cursorBlink.set(idleConf.GetOption('main', 'EditorWindow', + 'cursor-blink', default=True)) # additional help sources self.userHelpList = idleConf.GetAllExtraHelpSourcesList() for helpItem in self.userHelpList: @@ -1133,6 +1154,7 @@ instance.set_notabs_indentwidth() instance.ApplyKeybindings() instance.reset_help_menu_entries() + instance.UpdateCursorBlink() def Cancel(self): self.destroy() Index: Lib/idlelib/EditorWindow.py =================================================================== --- Lib/idlelib/EditorWindow.py (revision 70642) +++ Lib/idlelib/EditorWindow.py (working copy) @@ -109,6 +109,10 @@ text_frame, name='text', padx=5, wrap='none', width=self.width, height=idleConf.GetOption('main','EditorWindow','height') ) + # Store the current value of the insertofftime now so we can restore + # it if needed. + self.text._insertofftime = self.text['insertofftime'] + self.UpdateCursorBlink() self.top.focused_widget = self.text self.createmenubar() @@ -624,6 +628,16 @@ self.per.removefilter(self.color) self.color = None + def UpdateCursorBlink(self): + """Update the cursor blink configuration.""" + cursorblink = idleConf.GetOption( + 'main', 'EditorWindow', 'cursor-blink', type='bool') + if not cursorblink: + self.text.config(insertofftime=0) + else: + # Restore the original value + self.text.config(insertofftime=self.text._insertofftime) + def ResetColorizer(self): "Update the colour theme" # Called from self.filename_change_hook and from configDialog.py