mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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.
This commit is contained in:
parent
bb6193c553
commit
073b829021
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue