Hello Xavier,

I second this opinion. Still it is strange why your code worked
correctly on Cocoa.

I haven't read the spec. But even without having done so I would say
that posting a textDidChange notification is not of much use if the
delegate method is not able to figure out to what the value had been
changed. I don't know whether Apple is calling validateEditing, but
they definitely make sure that objectValue reflects the changes made
before this notification is posted.

Regards,

   Andreas

I dont have a Mac. But that make sense to me that the field was validated only when the edition ends. Before that the returned object would be nil most of the time. That's ok for a simple number but not for a more complex
object like a Date or Time.

Yes, I wondered about that as well. However, there probably will be much more number fileds in the average app than fields with more complex qualifiers. And for these fields it might be important to know the current contents even before editing ends.

I dont know what you need to do with the value of the field but the following
should always work :
[[valueField currentEditor] string]

Anyway you're right : your code should work. I found out in the Cocoa specs that the -*Value methods must invokes the -validateEditing method before extracting
and returning the value. -textDidChange doesnt.

IMHO the bug is in NSNumberFormatter. I did have problem with this class.

OK, so ...

Regards,

  Andreas



_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to