def _test():
class TestDialog(wxSpellCheckerDialog):
def __init__(self,*args):
wxSpellCheckerDialog.__init__(self,*args)
wx.EVT_CLOSE(self,self.OnClose)
def OnClose(self,evnt):
chkr = dlg.GetSpellChecker()
if chkr is not None:
printf(["AFTER:", chkr.get_text()])
self.Destroy()
from enchant.checker import SpellChecker
text = "This is sme text with a fw speling errors in it. Here are a fw more to tst it ut."
printf(["BEFORE:", text])
app = wx.PySimpleApp()
dlg = TestDialog()
chkr = SpellChecker("en_US",text)
dlg.SetSpellChecker(chkr)
dlg.Show()
app.MainLoop()
评论列表
文章目录