def on_ButtonLast( self, event ): win = (event.GetEventObject()).GetParent() for widget in win.GetChildren(): if type(widget) is wx.CheckBox and widget.IsChecked() == 0: dlg = wx.MessageDialog(win, "Not all items checked", "Error", wx.OK | wx.ICON_WARNING) dlg.ShowModal() dlg.Destroy() return #all checked, we're done. dlg = wx.MessageDialog(win, "Checklist Complete", "Done", wx.OK | wx.ICON_INFORMATION) dlg.ShowModal() dlg.Destroy()
def on_Button( self, event ): win = (event.GetEventObject()).GetParent() for widget in win.GetChildren(): if type(widget) is wx.CheckBox and widget.IsChecked() == 0: dlg = wx.MessageDialog(win, "Not all items checked", "Error", wx.OK | wx.ICON_WARNING) dlg.ShowModal() dlg.Destroy() return #all checked, go to next panel. win.GetParent().AdvanceSelection()
def error(self, msg): wx.MessageDialog(None, msg, 'Error!', wx.ICON_ERROR).ShowModal() return self.SUPER.error(self, msg)