summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2010-07-12 16:01:36 -0400
committerGuillaume Seguin <guillaume@segu.in>2010-07-12 16:01:36 -0400
commit3b30b6bb027d914adfa96d20e0d73092d17879ae (patch)
tree8d2df9b4fcf22eeaa3b2801fb0fd6a806e5cdc9b
parent17485af3112208db8c9069ad68074d7700c3c64f (diff)
downloadmultiwpcreator-3b30b6bb027d914adfa96d20e0d73092d17879ae.tar.gz
multiwpcreator-3b30b6bb027d914adfa96d20e0d73092d17879ae.tar.bz2
Fix cropper destroy bug
-rw-r--r--wpcreator/ui.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/wpcreator/ui.py b/wpcreator/ui.py
index b1debfa..14bb65f 100644
--- a/wpcreator/ui.py
+++ b/wpcreator/ui.py
@@ -113,6 +113,7 @@ class ImageItem (gtk.VBox):
def on_crop (self, widget):
self.cropperWindow = gtk.Window ()
+ self.cropperWindow.connect ("delete-event", self.hide_cropper)
self.cropperWindow.set_title ("Wallpaper Creator - Crop")
self.cropperWindow.set_modal (True)
self.cropperWindow.set_transient_for (mainWindow)
@@ -134,11 +135,16 @@ class ImageItem (gtk.VBox):
self.cropperWindow.add (box)
self.cropperWindow.show_all ()
+ def hide_cropper (self, window = None, event = None):
+ self.cropperWindow.get_child ().remove (self.cropper)
+ self.cropperWindow.destroy ()
+ self.cropperWindow = None
+ return True
+
def crop (self, button):
self.cropped = self.cropper.get_cropped_image ()
self.preview.set_cropped (self.cropped)
- self.cropperWindow.get_child ().remove (self.cropper)
- self.cropperWindow.destroy ()
+ self.hide_cropper ()
def set_number (self, number):
self.preview.set_number (number)