From de0fab078642e4934f56854a7721a52768a89db6 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 20 Jun 2013 01:08:57 +0000 Subject: [PATCH] - Fix: ColourSelectEvent must derive from wx.PyCommandEvent for its attributes to be preserved while passing through the event system. - Fix: Force a copy of the colour object in SetColour git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74264 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wx/lib/colourselect.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/wx/lib/colourselect.py b/wx/lib/colourselect.py index 8d8b5504..e9de9589 100644 --- a/wx/lib/colourselect.py +++ b/wx/lib/colourselect.py @@ -85,7 +85,7 @@ import functools wxEVT_COMMAND_COLOURSELECT = wx.NewEventType() -class ColourSelectEvent(wx.CommandEvent): +class ColourSelectEvent(wx.PyCommandEvent): """ :class:`ColourSelectEvent` is a special subclassing of :class:`CommandEvent` and it provides for a custom event sent every time the user chooses a colour. @@ -99,7 +99,7 @@ class ColourSelectEvent(wx.CommandEvent): :param Colour `value`: the colour currently selected. """ - wx.CommandEvent.__init__(self, id = id) + wx.PyCommandEvent.__init__(self, id = id) self.SetEventType(wxEVT_COMMAND_COLOURSELECT) self.value = value @@ -211,10 +211,7 @@ class ColourSelect(wx.BitmapButton): :type `colour`: tuple or string or :class:`Colour` """ - if not isinstance(colour, wx.Colour): - colour = wx.Colour(colour) - - self.colour = colour + self.colour = wx.Colour(colour) # use the typmap or copy an existing colour object bmp = self.MakeBitmap() self.SetBitmap(bmp)