summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/SearchDialogBase.py
diff options
context:
space:
mode:
authorChui Tey <chui.tey@advdata.com.au>2002-11-06 02:18:45 (GMT)
committerChui Tey <chui.tey@advdata.com.au>2002-11-06 02:18:45 (GMT)
commit5a231c8f790b1d48daa83fc14b54c056d1330d45 (patch)
tree49116bd80f1acd09dfdbafc005848ccd1f1ece75 /Lib/idlelib/SearchDialogBase.py
parent110aa50cc244cd4c32ab90aeed6e2ad6515365b5 (diff)
downloadcpython-5a231c8f790b1d48daa83fc14b54c056d1330d45.zip
cpython-5a231c8f790b1d48daa83fc14b54c056d1330d45.tar.gz
cpython-5a231c8f790b1d48daa83fc14b54c056d1330d45.tar.bz2
By default when getting the search menu, the currently highligted
text is the search term.
Diffstat (limited to 'Lib/idlelib/SearchDialogBase.py')
-rw-r--r--Lib/idlelib/SearchDialogBase.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/idlelib/SearchDialogBase.py b/Lib/idlelib/SearchDialogBase.py
index 3556ebf..c2a59c5 100644
--- a/Lib/idlelib/SearchDialogBase.py
+++ b/Lib/idlelib/SearchDialogBase.py
@@ -11,13 +11,16 @@ class SearchDialogBase:
self.engine = engine
self.top = None
- def open(self, text):
+ def open(self, text, searchphrase=None):
self.text = text
if not self.top:
self.create_widgets()
else:
self.top.deiconify()
self.top.tkraise()
+ if searchphrase:
+ self.ent.delete(0,"end")
+ self.ent.insert("end",searchphrase)
self.ent.focus_set()
self.ent.selection_range(0, "end")
self.ent.icursor(0)