def loader_cb(data): topic_list = Analyze.getTopicList(data) if topic_list is not None: store.clear() for topic in topic_list: chartName = topic['name'].encode("utf-8") chartId = topic['id'] chartType = topic['type'] chartPicURL = topic['picURL'] chartDesc = topic['desc'].encode("utf-8") store.append([chartName, chartId, chartType, chartPicURL, chartDesc]) self.load_label.set_label(_("Loaded")) else: msgBox = gtk.MessageDialog(parent=self.dialog, flags=gtk.DIALOG_MODAL, type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_CLOSE, message_format=_("No more topic list!")) msgBox.connect("response", lambda a, b: msgBox.hide()) msgBox.run() self.load_label.set_label(_("Loaded"))