[Gambas-user] Textedit and Spell checking

MaxVK maximvonk at ...626...
Sat Mar 29 00:05:58 CET 2008



Rob Kudla wrote:
> 
> There's no reason to try to use a perl module or integrate some other 
> GUI toolkit's spellchecker.  Try something like this:
> 
> dim aspell as process
> spellcheckresults = ""
> aspell = shell "aspell pipe" for read write as "aspell"
> print #aspell, textedit1.text ' if it is HTML, include -H in command
> 
> ...
> 
> public sub aspell_Read
> DIM sLine AS String
> READ #LAST, sLine ' maybe line input instead? 
> ' parse out aspell output and deal with it here
> ' it looks like this, one line per word: 
> ' * - indicates word found in dictionary, and if not:
> ' & <misspelled word> <number of guesses> <position in source string>: 
> ' followed by space separated guesses
> end
> 

Ah, you're a sanity saver Rob! This works pretty well, but I'm having
trouble because in the aspell_read routine I can collect the lines that
return showing an error into an array or a list, and I can parse the lines
as they come, however, there are a few problems:

Firstly I am trying to pop open a modal window that will show a list of the
suggested words, and give options to replace etc. However, I cant seem to
work out where to put the code for this, because if I show the modal window
during the aspell_read routine everything else is finished by the time I
return to it. This means I only get a chance to change one error word.

Secondly, the program never quits properly, so something is hanging on when
I exit, and I'm not sure what. Presumably I need to close the link with
aspell when the spelling routine has finished, but I'm unsure how to do
this.

Many thanks for your help so far. I'm so close to getting this working that
I can almost taste it!

Regards

Max
-- 
View this message in context: http://www.nabble.com/Textedit-and-Spell-checking-tp16359797p16364042.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list