code: def get_builder_toplevel(self, builder):
          
          toplevel = builder.get_object(self.toplevel_name)
          if not gobject.type_is_a(toplevel, gtk.Window):
              toplevel = None
          if toplevel is None:
              toplevel = get_first_builder_window(builder)
          return toplevel
docs: Get the toplevel widget from a gtk.Builder file.
  
          The main view implementation first searches for the widget named as
          self.toplevel_name (which defaults to "main". If this is missing, or not
          a gtk.Window, the first toplevel window found in the gtk.Builder is
          used.