From e1944ad852354e462ae0ce7ae51a64d1d746c09c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 23 Dec 2006 00:02:59 +0000 Subject: [PATCH 1/1] Don't try to access a color not in the dictionary git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44039 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/samples/wxPIA_book/Chapter-06/example7.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.45.2