def on_get_details_clicked(self, widget, data=None): word = self.get_word.get_text() dic = self.chose_dict.get_active_text() if dic == 'online webster': d = online_dict() defs = '\n' + '='*10 + '\n' + d.get_def(word) defs = 'from online webster:\n' + defs elif dic == 'offline wordnet': defs = '\n' + '='*10 + '\n' + wordnet.get_definition(word) buff = self.details.get_buffer() buff.set_text(defs) self.details.set_buffer(buff)
def on_get_details_clicked(self, widget, data=None): word = self.get_word.get_text() dic = self.chose_dict.get_active_text() if dic == 'online webster': d = online_dict() defs = '\n' + '=' * 10 + '\n' + d.get_def(word) defs = 'from online webster:\n' + defs elif dic == 'offline wordnet': defs = '\n' + '=' * 10 + '\n' + wordnet.get_definition(word) buff = self.details.get_buffer() buff.set_text(defs) self.details.set_buffer(buff)
def on_get_details1_clicked(self, widget, data=None): word = self.tree_value dic = self.chose_dict.get_active_text() print dic if dic == 'online webster': d = online_dict() defs = d.get_def(word) defs = '\n' + '='*10 + '\n' + "\nfrom online webster:\n" + defs elif dic == 'offline wordnet': defs = '\n' + '='*10 + '\n' + wordnet.get_definition(word) buff = self.output_txtview.get_buffer() end = buff.get_iter_at_offset(-1) buff.place_cursor(end) buff.insert_interactive_at_cursor(defs, True)
def on_get_details1_clicked(self, widget, data=None): word = self.tree_value dic = self.chose_dict.get_active_text() print dic if dic == 'online webster': d = online_dict() defs = d.get_def(word) defs = '\n' + '=' * 10 + '\n' + "\nfrom online webster:\n" + defs elif dic == 'offline wordnet': defs = '\n' + '=' * 10 + '\n' + wordnet.get_definition(word) buff = self.output_txtview.get_buffer() end = buff.get_iter_at_offset(-1) buff.place_cursor(end) buff.insert_interactive_at_cursor(defs, True)