import wx
class wxGUI(wx.App):
def OnInit(self):
frame = wx.Frame(parent=None, title='wxGUI', size=(160,140))
panel = wx.Panel(frame, -1)
buttonOK = wx.Button(panel, -1, 'OK', pos=(0,0))
self.Bind(wx.EVT_BUTTON, self.OnButtonOK, buttonOK)
frame.Show()
return True
def OnButtonOK(self, event):
colorDlg = wx.ColourDialog(None)
colorDlg.ShowModal()
color = colorDlg.GetColourData().Colour
wx.MessageBox(str(color))
app = wxGUI()
app.MainLoop()