return engine._searchdialog
def find(text):
- return _setup(text).open(text)
+ pat = text.get("sel.first", "sel.last")
+ return _setup(text).open(text,pat)
def find_again(text):
return _setup(text).find_again(text)
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)