def METHOD_NAME(self, isopen):
    self.isopen = isopen
    if isopen:
        topwindow = self.get_parent()
        while not isinstance(topwindow, Gtk.Window):
            topwindow = topwindow.get_parent()
        x_loc, y_loc = topwindow.get_window().get_position()
        x_loc += self.get_allocation().x + self.get_allocation().width
        y_loc += self.get_allocation().y
        self.subwindow.move(x_loc, y_loc)
    self.subwindow.props.visible = isopen
    self.set_state(self.isopen and Gtk.StateType.SELECTED or Gtk.StateType.NORMAL)