Remove gtkmozembed view widget from the frame - workaround for shutdown issues with... master
authorPaweł Paprota <ppawel@fastmail.fm>
Sun, 10 Aug 2008 18:34:39 +0000 (10 20:34 +0200)
committerPaweł Paprota <ppawel@fastmail.fm>
Sun, 10 Aug 2008 18:34:39 +0000 (10 20:34 +0200)
straw/Application.py
straw/ItemView.py

index 0dc3362..20038f2 100644 (file)
@@ -433,6 +433,7 @@ class ApplicationPresenter(MVP.BasicPresenter):
         feedproperties.show(self._curr_feed)
 
     def quit(self):
+        self._item_view.destroy()
         self._feed_list_presenter.store_state()
         ItemManager.shutdown()
         gtk.main_quit()
index 0b88e84..4bdb58f 100644 (file)
@@ -537,12 +537,12 @@ class ItemView:
         html_view = HTMLView(widget, document)
         self._html_presenter = HTMLPresenter(document, html_view)
 
-        widget = widget_tree.get_widget('html_scrolled_window')
-        parent = widget.parent
-        parent.remove(widget)
-        widget = gtk.Frame()
-        widget.set_shadow_type(gtk.SHADOW_IN)
-        parent.add(widget)
+        self.html_scrolled_window = widget_tree.get_widget('html_scrolled_window')
+        parent = self.html_scrolled_window.parent
+        parent.remove(self.html_scrolled_window)
+        self.html_scrolled_window = gtk.Frame()
+        self.html_scrolled_window.set_shadow_type(gtk.SHADOW_IN)
+        parent.add(self.html_scrolled_window)
 
 #        scroll_view = ScrollView(widget)
 #        self._scroll_presenter = ScrollPresenter(view=scroll_view)
@@ -553,16 +553,19 @@ class ItemView:
 #        self._scroll_presenter.view.add_child(child)
 #        self._scroll_presenter.show_view()
 
-        widget.add(child)
+        self.html_scrolled_window.add(child)
         # gtkmozembed visibility workaround        
         child.show()
-        widget.show()
+        self.html_scrolled_window.show()
         # gtkhtml visibility workaround
-        widget.show_all()
+        self.html_scrolled_window.show_all()
 
         #config = Config.get_instance()
         #elf._html_presenter.set_view_magnification(config.text_magnification)
 
+    def destroy(self):
+        self.html_scrolled_window.remove(self._html_presenter.get_view_widget())
+
     def itemlist_selection_changed(self, selection, column):
         (model, treeiter) = selection.get_selected()
         if not treeiter: return   # .. or display a template page?