def receive_article(self, item): """ A worker thread delivered an article to the view, see if it is current then display it if so """ assert self.content_view is not None current_item = self.gatherer.item(self.last_item_feed_name, self.last_item_index) if item == current_item: TextFormat.prepare_content_display(item, self.content_view)
def show_new_content(self, tree_view): model, it = tree_view.get_selection().get_selected() if model and it: self.get_info_from_headline(model[it]) self.color_headline(model[it], string_to_RGBA(self.appearance()['Read Color'])) item = self.gatherer.item(self.last_item_feed_name, self.last_item_index) if item.article: TextFormat.prepare_content_display(item, self.content_view) else: self.gatherer.request(item)
def create_content_box() -> (Gtk.ScrolledWindow, Gtk.TextView): text_scroll = Gtk.ScrolledWindow() text_scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.ALWAYS) text_view = TextFormat.prepare_content_display(None, None) text_scroll.add(text_view) return text_scroll, text_view
def show_new_content(self, tree_view: Gtk.TreeView) -> None: model, it = tree_view.get_selection().get_selected() if model and it: item = self.news_store.row_to_item(model[it]) TextFormat.prepare_content_display(item, self.content_view)
def create_content_box(): text_scroll = Gtk.ScrolledWindow() text_scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.ALWAYS) text_view = TextFormat.prepare_content_display(None, None) text_scroll.add(text_view) return text_scroll, text_view