]> granicus.if.org Git - python/commitdiff
1. Find in Files Dialog shows text selection if there is one
authorKurt B. Kaiser <kbk@shore.net>
Sat, 7 Jun 2003 03:21:17 +0000 (03:21 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Sat, 7 Jun 2003 03:21:17 +0000 (03:21 +0000)
2. Remove obsolete comment associated with Window menu updating

M EditorWindow.py
M GrepDialog.py

Lib/idlelib/EditorWindow.py
Lib/idlelib/GrepDialog.py

index da08d7151afbfbf7b7e6d72eb7422800730321ca..c63823aa708dc25e9f64925e5fe0efb258786b60 100644 (file)
@@ -259,9 +259,6 @@ class EditorWindow:
 
     def postwindowsmenu(self):
         # Only called when Windows menu exists
-        # XXX Actually, this Just-In-Time updating interferes badly
-        # XXX with the tear-off feature.  It would be better to update
-        # XXX all Windows menus whenever the list of windows changes.
         menu = self.menudict['windows']
         end = menu.index("end")
         if end is None:
index 84cac0ea31a9c8c59b4a02dde5a20018715b577e..79fad31a746c558db6ad524ed12a53686e1468f3 100644 (file)
@@ -11,7 +11,8 @@ def grep(text, io=None, flist=None):
     if not hasattr(engine, "_grepdialog"):
         engine._grepdialog = GrepDialog(root, engine, flist)
     dialog = engine._grepdialog
-    dialog.open(io)
+    searchphrase = text.get("sel.first", "sel.last")
+    dialog.open(text, searchphrase, io)
 
 class GrepDialog(SearchDialogBase):
 
@@ -25,8 +26,8 @@ class GrepDialog(SearchDialogBase):
         self.globvar = StringVar(root)
         self.recvar = BooleanVar(root)
 
-    def open(self, io=None):
-        SearchDialogBase.open(self, None)
+    def open(self, text, searchphrase, io=None):
+        SearchDialogBase.open(self, text, searchphrase)
         if io:
             path = io.filename or ""
         else: