GtkSpellCheckerDialog / wxSpellCheckerDialog : get corrected text ?

9 views
Skip to first unread message

flore...@gmail.com

unread,
Jun 25, 2013, 5:12:56 PM6/25/13
to pyencha...@googlegroups.com
Hi,

I have a problem using pyenchant : I can launch GtkSpellCheckerDialog with a specific text, with this code :

text = textbuffer.get_text(textbuffer.get_start_iter(),textbuffer.get_end_iter())
printf(["BEFORE:", text])
chk_dlg = GtkSpellCheckerDialog()
chk_dlg.set_icon_from_file('favicon1.ico')
chk_dlg.show()
chk_dlg.connect('delete_event', validAbc)
chkr = SpellChecker("fr",self.text)
chk_dlg.setSpellChecker(chkr)
chk_dlg.updateUI()
(textbuffer is a buffer defined before in my program).

Now, I try to get the corrected text generated by GtkSpellCheckerDialog. How can I do that ?

Thank you in advance for your help !

Floréal.

Ryan Kelly

unread,
Jul 1, 2013, 2:13:46 AM7/1/13
to pyencha...@googlegroups.com, flore...@gmail.com
Sorry for the delay in responding. The SpellChecker object has a
"get_text" method that can be used like this:

chkr = SpellChecker("fr",self.text)
chk_dlg.setSpellChecker(chkr)
chk_dlg.updateUI()
print chkr.get_text()


Hope this helps,

Ryan

flore...@gmail.com

unread,
Jul 2, 2013, 6:16:08 PM7/2/13
to pyencha...@googlegroups.com, flore...@gmail.com
Thanks, it works !! I can now have pyenchant in my python program,

Thank you so much for your help :)

Floréal.
Reply all
Reply to author
Forward
0 new messages