Fix Gtk deprecation Widget.reparent

This commit is contained in:
prculley 2019-09-13 16:14:13 -05:00 committed by Nick Hall
parent 831c7f9c66
commit 4d0e86a2e8
3 changed files with 8 additions and 4 deletions

View File

@ -175,7 +175,8 @@ class PaperFrame(Gtk.Box):
self.paper_grid.show_all()
# Shift the grid from glade toplevel window to this box
self.paper_grid.reparent(self)
self.paper_grid.get_parent().remove(self.paper_grid)
self.add(self.paper_grid)
# need to get rid of glade toplevel now that we are done with it.
self.top.destroy()

View File

@ -701,7 +701,8 @@ class DetachedWindow(ManagedWindow):
self.gramplet.detached_width = size[0]
self.gramplet.detached_height = size[1]
self.gramplet.detached_window = None
self.gramplet.reparent(self.grampletbar)
self.notebook.remove(self.gramplet)
self.grampletbar.add(self.gramplet)
ManagedWindow.close(self, *args)
#-------------------------------------------------------------------------

View File

@ -246,7 +246,8 @@ class GrampletWindow(ManagedWindow):
# add gramplet:
if self.gramplet.pui:
self.gramplet.pui.active = True
self.gramplet.mainframe.reparent(self.window.vbox)
self.gramplet.mainframe.get_parent().remove(self.gramplet.mainframe)
self.window.vbox.add(self.gramplet.mainframe)
self.window.connect('response', self.handle_response)
self.show()
# After we show, then we hide:
@ -310,7 +311,8 @@ class GrampletWindow(ManagedWindow):
expand = self.gramplet.gstate == "maximized" and self.gramplet.expand
column = pane.columns[col]
parent = self.gramplet.pane.get_column_frame(self.gramplet.column)
self.gramplet.mainframe.reparent(parent)
self.gramplet.mainframe.get_parent().remove(self.gramplet.mainframe)
parent.add(self.gramplet.mainframe)
if self.gramplet.pui:
self.gramplet.pui.active = self.gramplet.pane.pageview.active
for gframe in stack: