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
This commit is contained in:
Robin Dunn
2006-12-23 00:02:59 +00:00
parent cefcc57db8
commit e1944ad852

View File

@@ -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)