def error_message(self, message): count = self.message_listctrl.GetItemCount() self.message_listctrl.InsertItem(count, message) if not self.cp.IsExpanded(): self.cp.Expand() evt = wx.CollapsiblePaneEvent(self, self.cp.GetId(), False) wx.PostEvent(self.cp, evt)
def OnButton(self, event): """ Handles the wx.EVT_BUTTON event for PyCollapsiblePane. """ if event.GetEventObject() != self._pButton: event.Skip() return self.Collapse(not self.IsCollapsed()) # this change was generated by the user - send the event ev = wx.CollapsiblePaneEvent(self, self.GetId(), self.IsCollapsed()) self.GetEventHandler().ProcessEvent(ev)
def OnButton(self, event): """ Handles the ``wx.EVT_BUTTON`` event for :class:`PyCollapsiblePane`. :param `event`: a :class:`CommandEvent` event to be processed. """ if event.GetEventObject() != self._pButton: event.Skip() return self.Collapse(not self.IsCollapsed()) # this change was generated by the user - send the event ev = wx.CollapsiblePaneEvent(self, self.GetId(), self.IsCollapsed()) self.GetEventHandler().ProcessEvent(ev)