Kaydet (Commit) 073b8290 authored tarafından Fred Drake's avatar Fred Drake

When a file name is selected ("OK" button, <Return> in the filename entry),

and the "key" keyword parameter was used to invoke .go(), use the directory
of the selected file as the stored directory to return to when the same key
is used again.  This is useful since the user may well entry at least part
of the path in the filename box instead of doing a lot of clicking around in
the listboxes.
üst bb6193c5
......@@ -122,7 +122,11 @@ class FileDialog:
self.top.grab_set()
self.how = None
self.master.mainloop() # Exited by self.quit(how)
if key: dialogstates[key] = self.get_filter()
if key:
directory, pattern = self.get_filter()
if self.how:
directory = os.path.dirname(self.how)
dialogstates[key] = directory, pattern
self.top.destroy()
return self.how
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment