Evo, dok se ne nadje nesto bolje, moze i ovo da posluzi:
Code:
import wx
class MainFrame(wx.Frame):
def __init__(self,parent,id):
wx.Frame.__init__(self,parent,id,title="",size=(100,200))
panel=wx.Panel(self)
self.tc=wx.TextCtrl(panel,-1)
self.tc.Bind(wx.EVT_CHAR,self.act)
def act(self,event):
self.a=self.tc.GetInsertionPoint()
self.b=self.tc.GetValue()
event.Skip()
wx.CallAfter(self.act2)
def act2(self):
if self.b != self.tc.GetValue():
x=self.tc.GetValue()
self.tc.SetValue(x[:self.a+1]+x[self.a+2:])
self.tc.SetInsertionPoint(self.a+1)
app=wx.PySimpleApp()
frame=MainFrame(None,-1)
frame.Show(True)
app.MainLoop()
Nijedan nepušač još nije preživeo.