Skip to content

Loading…

backend gtk and gtk3: destroy figure save dialog after use; closes #2073 #2074

Merged
merged 1 commit into from

2 participants

@efiring
Matplotlib Developers member

No description provided.

@efiring efiring was assigned
@mdboom mdboom merged commit 7ec5ade into matplotlib:v1.2.x

1 check passed

Details default The Travis CI build passed
@efiring efiring deleted the efiring:gtk3save branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 7 additions and 3 deletions.
  1. +3 −1 lib/matplotlib/backends/backend_gtk.py
  2. +4 −2 lib/matplotlib/backends/backend_gtk3.py
View
4 lib/matplotlib/backends/backend_gtk.py
@@ -739,7 +739,9 @@ def get_filechooser(self):
return fc
def save_figure(self, *args):
- fname, format = self.get_filechooser().get_filename_from_user()
+ chooser = self.get_filechooser()
+ fname, format = chooser.get_filename_from_user()
+ chooser.destroy()
if fname:
try:
self.canvas.print_figure(fname, format=format)
View
6 lib/matplotlib/backends/backend_gtk3.py
@@ -543,11 +543,13 @@ def get_filechooser(self):
return fc
def save_figure(self, *args):
- fname, format = self.get_filechooser().get_filename_from_user()
+ chooser = self.get_filechooser()
+ fname, format = chooser.get_filename_from_user()
+ chooser.destroy()
if fname:
try:
self.canvas.print_figure(fname, format=format)
- except Exception, e:
+ except Exception as e:
error_msg_gtk(str(e), parent=self)
def configure_subplots(self, button):
Something went wrong with that request. Please try again.