Ask a Question related to Mac Programming, Design and Development.
-
Jamal Bernhard #1
help changing first responder
NSTextField is really kicking my ass... :-)
If the user edits a text field and the value is invalid, I want to pop
up an alert, restore the previous value, and keep the field as first
responder. I can do the first two just fine in the text field action,
but I can't figure out how to stop first responder from changing. First
I tried makeFirstResponder. Then I figured the text field action is
being sent before the event that caused it (tab, for example) is being
processed, so I tried flushBufferedKeyEvents but that didn't work either
(and anyway that wouldn't work for mouse clicks?). Out of ideas right
now...
Also, is using a formatter the only way to limit the number of
characters in a text field?
Thanks in advance,
Jamal Bernhard Guest
-
Changing JPG in SWF through ASP
I have a page with three frames. the left frame with images1 thumbnails, the right with images2 thumbnails. Both have Hyperlink in order to pass... -
Creating email auto-responder
Hello, I am wondering how would I be able to develop an email auto-responder for POP mails? Do I have to use event gateways? If so which gateway... -
Changing text without changing frames.
I have a small flash movie that is basically a color chooser. Rather than changing the color of an item by putting the color in a frame I change... -
#26101 [NEW]: FastCGI PHP fails as a local responder under Zeus 4.2
From: david at geektech dot com Operating system: FreeBSD 4.9-STABLE PHP version: 5.0.0b1 (beta1) PHP Bug Type: CGI related... -
movie location changing when there's nothing changing its location
I have a cross-platform program (each half using a different engine (quicktime for mac and MPEG Advance for pc). On both sides and on most computers... -
Michael Ash #2
Re: help changing first responder
In article
<jamalbspambegone-E85813.02581916082003@news.sf.sbcglobal.net>,
Jamal Bernhard <jamalbspambegone@pacbell.goawayspam.net> wrote:
If that truly is the problem, then try something like this:> NSTextField is really kicking my ass... :-)
>
> If the user edits a text field and the value is invalid, I want to pop
> up an alert, restore the previous value, and keep the field as first
> responder. I can do the first two just fine in the text field action,
> but I can't figure out how to stop first responder from changing. First
> I tried makeFirstResponder. Then I figured the text field action is
> being sent before the event that caused it (tab, for example) is being
> processed, so I tried flushBufferedKeyEvents but that didn't work either
> (and anyway that wouldn't work for mouse clicks?). Out of ideas right
> now...
[window performSelector:@selector(makeFirstResponder:)
withObject:textField afterDelay:0.0];
This will send makeFirstResponder: after your program gets back to the
main event loop.
Michael Ash Guest
-
Simon Slavin #3
Re: help changing first responder
In article <jamalbspambegone-E85813.02581916082003@news.sf.sbcglobal.net>,
Jamal Bernhard <jamalbspambegone@pacbell.goawayspam.net> wrote:
Your code to revert to the original value should be put into>If the user edits a text field and the value is invalid, I want to pop
>up an alert, restore the previous value, and keep the field as first
>responder. I can do the first two just fine in the text field action,
>but I can't figure out how to stop first responder from changing.
the 'textShouldEndEditing:' delegate for the text field or
handled via the default code for it. This automatically
handles cases where the new text is not acceptable for that
field. See 'NSTextField' for documentation.
Note that reverting to the earlier version of the text if the
new text is unacceptable is /not/ the Macintosh way. You're
meant to leave the new text exactly the way it is so that the
user can modify it further. If they decide they want to
revert to the original text they can use the 'Undo' menu item
all by themselves.
Simon Slavin Guest



Reply With Quote

