I used to read the sample codes and then edit my codes in the modified
version and then run the code.
I am a newbie and I googled online for more resources. After I copied
some codes from a website and put it in the modified version of
CheckBox, which I am working on. It crushes.
Now even after I restart wxPython demo or computer, it does not help.
Once I clicked on Demo and goes to Core Windows/Controls and to
CheckBox, the wxPython Demo is freezed and the mouse showing it is
running for ever and it does not respond any more. I guess something
went wrong. But the problem is I can not correct it because now the
wxPython does not respond any more. Anybody can give any suggestions?
I don't want to re-install the software.
The part of code is the following:
#!/usr/bin/python
# checkbox.py
import wx
class CheckBox(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, size=(250, 170))
panel = wx.Panel(self, -1)
self.cb = wx.CheckBox(panel, -1, 'Show Title', (10, 10))
self.cb.SetValue(True)
wx.EVT_CHECKBOX(self, self.cb.GetId(), self.ShowTitle)
self.Show()
self.Centre()
def ShowTitle(self, event):
if self.cb.GetValue():
self.SetTitle('checkbox.py')
else: self.SetTitle('')
app = wx.App()
CheckBox(None, -1, 'checkbox.py')
app.MainLoop()