[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSTextField.m patch
From: |
Nicola Pero |
Subject: |
Re: NSTextField.m patch |
Date: |
Thu, 27 Jun 2002 11:58:37 +0100 (BST) |
> Hi, Nicola Pero.
>
> NP> > Create NSTextField. Enter into it some text. Press Return key. Entire
> NP> > contents of the text field should be selected(highlighted). But it
> doesn't.
> NP> > Moreover, if i try to select text by NSTextFiled's selectText:
> NP> > method (in controlTextDidEndEditing: delegate's method), text flashes
> NP> > from selected(highlighted) to unselected and stays unselected.
> NP>
> NP> Ok - thanks - I didn't know about this possibility - but it seems you are
> NP> right - the NeXTSTEP 3.3 user interface guidelines and documentation
> NP> clearly states -
>
> [User Interface Guide thoughts skipped]
>
> NP> I think calling selectText: in controlTextDidEndEditing: should do it ...
> NP> but I can see why it didn't - I think the bug was in NSTextField.m, which
> NP> was posting the 'NSControlTextDidEndEditing' notification too early -
> NP> before actually ending editing!
> NP>
> NP> I fixed this on CVS - if you try again from CVS, hopefully now using
> NP> selectText: inside controlTextDidEndEditing: should now work :-) [I
> didn't
> NP> try it, so please let me know if you still have problems]
>
> I've just tried it again. Now text selection even not flashes ;) I'll
> create
> a little test so you can try it for yourself.
Thanks for the little test ... still a tiny bit of NSTextField end editing
operations where done after the notification was posted ... I fixed it on
CVS and now the little text works for me :-) hope it works for you as well
About the other bug you report in the email you sent me, the one about
'NSTextField -makeFirstResponder' not actually working, that was already
reported by David Ayers with full explanations of both the problem and a
possible fix to it and it's only my fault if I've not yet applied some
sort of patch derived from his careful and very good indeed observations.
I'll try to address that issue maybe tonight.
As a quick fix, you can use [textField selectText: self] instead of
[window makeFirstResponder: textField] for now. I know it's not as
satisfactorily, because you can't use the setInitialFirstResponder: to
have it done automatically (as you could do if makeFirstResponder: was
actually working properly), but anyway.
Thanks for your reports - that was helpful.