def cw_btn_clicked(self, *args): def cleanup(arg): del self.cw self.cw = None if not self.cw: home = expanduser("~") self.cw = CoverWindow(self.source.plugin, self.cw_btn.get_toplevel(), home) self.cw.connect('close-window', cleanup) self.cw.show_all(' ', self.pixbuf)