mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Programming (https://www.mersenneforum.org/forumdisplay.php?f=29)
-   -   Any Cocoa experts? (https://www.mersenneforum.org/showthread.php?t=13427)

Prime95 2010-05-22 03:09

Any Cocoa experts?
 
I have 2 problems that I cannot find an answer to quickly:

1) When I click on a text field and change the value and then click on the "OK" button, the changed value is ignored. The changed text is only registered if I tab out of the field. What have I done wrong?

2) Is there any way to get the Test/Status NSTextField to not highlight misspelled words like "Mersenne", "Lucas", and "Lehmer"?

rogue 2010-05-22 13:28

For the button, does this help? [url]http://osdir.com/ml/cocoa-dev/2010-04/msg00457.html[/url]

And for spelling, how about this? [url]http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Protocols/NSIgnoreMisspelledWords_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSIgnoreMisspelledWords[/url]

Prime95 2010-05-22 21:07

[QUOTE=rogue;215708]For the button, does this help?[/quote]

Googling that method found the recommended procedure to use (makeFirstResponder). Thanks.

[quote]And for spelling, how about this? [/QUOTE]

I'd seen that before. I think it is a dead end.

At least the more offensive of the two bugs is fixed.

rogue 2010-05-22 22:35

I realized after I posted that NSTextField does not inherit from NSText, thus it probably works differently.

Would NSTextView work better for you than NSTextField? It inherits from NSText.

Something else I see is that NSTextField contains an NSTextView object. You can find that here: [url]http://developer.apple.com/mac/library/documentation/cocoa/reference/ApplicationKit/ObjC_classic/Intro/IntroAppKit.html[/url], which you have probably already seen. In other words, if you access that NSTextView object of the NSTextField class then you should be able to add words to the ignore list as shown in the other link I provided.

Prime95 2010-05-23 00:51

I was hoping to just turn spell checking off rather than assembling a list of words to ignore.

potonono 2010-05-26 00:57

This has a solution for turning it on, so perhaps you can set it to NO to turn it off.

[URL="http://stackoverflow.com/questions/2825269/how-do-i-enable-spell-checking-within-an-nstextfield-on-mac-os-x"]http://stackoverflow.com/questions/2825269/how-do-i-enable-spell-checking-within-an-nstextfield-on-mac-os-x[/URL]

[QUOTE]
// Focus TextField
[textField becomeFirstResponder];

// Disable Continous Spelling
NSTextView *textView = (NSTextView *)[self.window firstResponder];
[textView setContinuousSpellCheckingEnabled:NO];
[/QUOTE]


All times are UTC. The time now is 15:55.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.