Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a Quit? dialog for the last image.

Fix a GTK warning that, curiously, shows up in Squeeze but not in Pangolin.
  • Loading branch information...
commit 47f9790d4e67ed49544ee5e58e83a44c8ffd9d6b 1 parent 660e946
@akkana authored
Showing with 12 additions and 3 deletions.
  1. +3 −3 MetaPho/gtkpho.py
  2. +9 −0 metapho
View
6 MetaPho/gtkpho.py
@@ -21,7 +21,7 @@ def __init__(self, parentwin) :
self.parentwin = parentwin
self.title = gtk.Label("Tags")
- self.attach_defaults(self.title, 0, 2, 0, 1 );
+ self.attach(self.title, 0, 2, 0, 1 );
self.title.show()
self.cur_img = None
self.highlightBG = gtk.gdk.color_parse("#FFFFFF")
@@ -44,7 +44,7 @@ def __init__(self, parentwin) :
left = 2
button = gtk.ToggleButton(buttonchar)
- self.attach_defaults(button, left, left+1, i+1, i+2 );
+ self.attach(button, left, left+1, i+1, i+2 );
self.buttons.append(button)
button.connect("toggled", self.toggled, i)
@@ -53,7 +53,7 @@ def __init__(self, parentwin) :
#entry.connect("changed", self.entry_changed, i)
#entry.connect("focus-in-event", self.focus_in, i)
entry.connect("focus-out-event", self.focus_out, i)
- self.attach_defaults(entry, left+1, left+2, i+1, i+2 );
+ self.attach(entry, left+1, left+2, i+1, i+2 );
self.entries.append(entry)
self.show()
View
9 metapho
@@ -134,6 +134,15 @@ class MetaPhoWindow(object):
else : # couldn't load anything in the list
print "No more images"
+ dialog = gtk.MessageDialog(self.win,
+ gtk.DIALOG_DESTROY_WITH_PARENT,
+ gtk.MESSAGE_QUESTION,
+ gtk.BUTTONS_OK_CANCEL,
+ "No more images: quit?")
+ response = dialog.run()
+ dialog.destroy()
+ if response == gtk.RESPONSE_OK :
+ self.quit()
def prevImage(self) :
loaded = False
Please sign in to comment.
Something went wrong with that request. Please try again.