def METHOD_NAME(self, event):
    # self.Freeze()
    if self._toggled:
        # If we are expanded, save previous size and collapse by setting
        # content height to 0
        self.content_min_size = self.content_panel.GetSize()
        self.content_panel.SetMinSize((self.content_min_size[0], 0))
        self.header_arrow.SetLabel("\u25b6")
    else:
        # If we are collapsed, set content size to previously saved value
        self.content_panel.SetMinSize(self.content_min_size)
        self.header_arrow.SetLabel("\u25bc")
    self._toggled = not self._toggled
    # self.Thaw()
    if self.force_layout:
        self.parent.Layout()
    else:
        self.OnStateChange(self.GetBestSize())