Hi, I''m running WxRuby2 on Mac OS X. Something is spell checking the text that I put into it; words it doesn''t recognize get an annoying red line under them. How can I turn the spell checker off? Thanks, Paul
Paul Legato wrote:> I''m running WxRuby2 on Mac OS X. Something is spell checking the text > that I put into it; words it doesn''t recognize get an annoying red > line under them. How can I turn the spell checker off? >Hmm ... I''m running OS X but haven''t ever seen this. What version of OS X are you using? Can you see this spellchecking in samples/text/textctrl.rb? thanks alex
> Hmm ... I''m running OS X but haven''t ever seen this. What version of OS > X are you using?I also see this using 10.4.9> Can you see this spellchecking in samples/text/textctrl.rb?Yes I can spell check in that sample. To turn it off he can right click (or control click) in the text area, in the spelling menu of the pop up select ''Check Spelling as You Type'' so it does not show a check mark. The problem with the above fix is that it needs to be done to every text area and must be redone every time the app is restarted. Sean
I''m on 10.4.8. Spellchecking is being done in samples/text/textctrl.rb. Turning off spellcheck via the right click menu works, but it''s not really suitable for an app that is going to always display data that is not in the dictionary in a textctrl.... I need a way to turn it off programmatically. Can this be done? Thanks, Paul On 4/20/07, Sean Long <sean.m.long at gmail.com> wrote:> > Hmm ... I''m running OS X but haven''t ever seen this. What version of OS > > X are you using? > > I also see this using 10.4.9 > > > Can you see this spellchecking in samples/text/textctrl.rb? > > Yes I can spell check in that sample. > > To turn it off he can right click (or control click) in the text area, > in the spelling menu of the pop up select ''Check Spelling as You Type'' > so it does not show a check mark. > > The problem with the above fix is that it needs to be done to every > text area and must be redone every time the app is restarted. > > Sean > _______________________________________________ > wxruby-users mailing list > wxruby-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/wxruby-users >
Paul Legato wrote:> I''m on 10.4.8. Spellchecking is being done in samples/text/textctrl.rb. > > Turning off spellcheck via the right click menu works, but it''s not > really suitable for an app that is going to always display data that > is not in the dictionary in a textctrl.... I need a way to turn it off > programmatically. Can this be done? >Paul, Sean, thanks for the info. Had a look at the Apple Carbon API reference and this was indeed added to the native text control that wxWidgets wraps in 10.4 (I''m on 10.3). There isn''t any way to control this programmatically in wxWidgets 2.6.3, and hence in current wxRuby releases. However wxWidgets 2.8 adds a TextCtrl#CheckSpelling method for Mac, which accepts a boolean to switch this on or off. We should be able to add support for this method in wxRuby on the current development branch which targets 2.8.3 and hence for the next release. Sean - I can''t test this out, but I think we should add something roughly like the following to swig/classes/include/wxTextCtrl.h to create a TextCtrl#check_spelling method. #ifdef __WXMAC__ #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 void CheckSpelling(bool check); #endif #endif Paul - with this added, you should be able to do something like: if text_ctrl.respond_to?(:check_spelling) text_ctrl.check_spelling(false) end cheers alex
Alex, Your method worked except the public method name is MacCheckSpelling, I just did a rename in the .i to check_spelling. It works fine, I already committed it to svn. Sean> Sean - I can''t test this out, but I think we should add something > roughly like the following to swig/classes/include/wxTextCtrl.h to > create a TextCtrl#check_spelling method.> #ifdef __WXMAC__ > #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 > void CheckSpelling(bool check); > #endif > #endif > > Paul - with this added, you should be able to do something like: > > if text_ctrl.respond_to?(:check_spelling) > text_ctrl.check_spelling(false) > end