X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/be05b434519887d3e8c1634120d52e052b0530c1..4976f9967a2dd37dc501e187d7b13a1e6ca22966:/wxPython/samples/wxPIA_book/Chapter-06/example7.py diff --git a/wxPython/samples/wxPIA_book/Chapter-06/example7.py b/wxPython/samples/wxPIA_book/Chapter-06/example7.py index 626827fbe0..74f91ac4d8 100644 --- a/wxPython/samples/wxPIA_book/Chapter-06/example7.py +++ b/wxPython/samples/wxPIA_book/Chapter-06/example7.py @@ -188,7 +188,7 @@ class SketchFrame(wx.Frame): dlg.Destroy() def OnOtherColor(self, event): - dlg = wx.ColourDialog(frame) + dlg = wx.ColourDialog(self) dlg.GetColourData().SetChooseFull(True) if dlg.ShowModal() == wx.ID_OK: self.sketch.SetColor(dlg.GetColourData().GetColour()) @@ -302,7 +302,7 @@ class ControlPanel(wx.Panel): def OnSetColour(self, event): color = self.colorMap[event.GetId()] - if color != self.sketch.color: + if color != self.sketch.color and self.sketch.color in self.colorButtons: self.colorButtons[self.sketch.color].SetToggle(False) self.sketch.SetColor(color)