Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 47e743b

Browse files
committed
fixed gtk main quit bug
svn path=/trunk/matplotlib/; revision=2091
1 parent de39757 commit 47e743b

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2006-02-22 Fixed gtk main quit bug when quit was called befoer
2+
mainloop. - JDH
3+
14
2006-02-22 Small change to colors.py to workaround apparent
25
bug in numpy masked array module - JW
36

lib/matplotlib/backends/backend_gtk.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ def show(mainloop=True):
7777

7878
if mainloop and gtk.main_level() == 0:
7979
gtk.main()
80-
80+
show._mainloop = True
81+
show._mainloop = False
8182

8283
def new_figure_manager(num, *args, **kwargs):
8384
"""
@@ -452,8 +453,9 @@ def notify_axes_change(fig):
452453
def destroy(self, *args):
453454
if _debug: print 'FigureManagerGTK.%s' % fn_name()
454455
self.window.destroy()
455-
if Gcf.get_num_fig_managers() == 0 and not matplotlib.is_interactive():
456-
gtk.main_quit()
456+
457+
if Gcf.get_num_fig_managers()==0 and not matplotlib.is_interactive():
458+
if show._mainloop: gtk.main_quit()
457459

458460

459461
def full_screen_toggle (self):

0 commit comments

Comments
 (0)