I haven't actually run the program, but I noticed the "FIXME" comment about the About window not closing. Here is one way you can fix that:
1. Create a function that handles the closing of the dialog:
Code:
def closeAbout(self, widget, data=None):
self.about_box.hide()
return True
2. Move the code that creates the dialog to __init__, and save it as part of the object. Also tell the dialog what function to call when it receives "destroy" or "delete_event" events. E.g., in __init__:
Code:
icon = gtk.gdk.pixbuf_new_from_file("pixmaps/bzr-grab.svg")
self.about_box = gtk.AboutDialog()
self.about_box.set_name(__title__)
self.about_box.set_version(__version__)
self.about_box.set_copyright("Copyright (C) David Futcher ('bobbo') 2008")
self.about_box.set_comments("A simple GTK frontend to bzr 'branch'")
self.about_box.set_authors(__authors__)
self.about_box.set_logo(icon)
self.about_box.connect("destroy", self.closeAbout)
self.about_box.connect("delete_event", self.closeAbout)
3. Simplify showAbout to this:
Code:
def showAbout(self, widget):
self.about_box.show()
EDIT: I haven't used Glade, so I don't know if my suggestions will conflict with any of the Glade code.
Bookmarks