I have the StyledTextCtrl working it is AutoCompleting the words. and adding them to the list. but it is kinda messy the way that I have it checking to see if the space bar was pressed so it can add the word to the choices list. I am calling a wx.EVT_KEY_DOWN event with the fallowing code.
I have the StyledTextCtrl working it is AutoCompleting the words. and adding them to the list. but it is kinda messy the way that I have it checking to see if the space bar was pressed so it can add the word to the choices list. I am calling a wx.EVT_KEY_DOWN event with the fallowing code.
self.Bind( wx.EVT_KEY_DOWN, self.OnKeyDown, self ) #Line 19
then i check to see if space bar was pressed with
def OnKeyDown(self,event): #line 36
KC = event.GetKeyCode()
if event.GetKeyCode() == wx.WXK_SPACE:
self.AddWord(self.CurentWord)
event.Skip()
else:
event.Skip()
How about a four liner?
def OnKeyDown(self,event):
if event.GetKeyCode() == wx.WXK_SPACE:
self.AddWord(self.CurentWord)
event.Skip()
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!