]> granicus.if.org Git - python/commitdiff
Apply Josh Robb's Patch:
authorKurt B. Kaiser <kbk@shore.net>
Sun, 6 Oct 2002 01:57:45 +0000 (01:57 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Sun, 6 Oct 2002 01:57:45 +0000 (01:57 +0000)
[ 617097 ] EditorWindow.py: underline recent files

Added a couple of mods to reduce the indentation level.

Note that the recent files menu doesn't update until
Idle is restarted, pre-existing bug, at least on Linux.

Lib/idlelib/EditorWindow.py

index 594a08580ff9cb2afc94724d697598d3ca1ec818..f5e3add0e99fba62e8f4fb3b089008c03f0ff3f4 100644 (file)
@@ -567,13 +567,21 @@ class EditorWindow:
         #print self.flist.inversedict
         #print self.top.instanceDict
         #print self
+        ullist = "1234567890ABCDEFGHIJ"
         if rfList:
             for instance in self.top.instanceDict.keys():
-                instance.menuRecentFiles.delete(1,END)
+                menu = instance.menuRecentFiles
+                menu.delete(1,END)
+                i = 0 ; ul = 0; ullen = len(ullist)                
                 for file in rfList:
                     fileName=file[0:-1]
-                    instance.menuRecentFiles.add_command(label=fileName,
-                            command=instance.__RecentFileCallback(fileName))
+                    callback = instance.__RecentFileCallback(fileName)
+                    if i > ullen: # don't underline menuitems
+                        ul=None
+                    menu.add_command(label=ullist[i] + " " + fileName,
+                                     command=callback,
+                                     underline=ul)
+                    i += 1
                     
     def __CleanRecentFiles(self,rfList):
         origRfList=rfList[:]