List Info

Thread: NSControl fix




NSControl fix
country flaguser name
Germany
2007-08-29 17:12:50
Hi all,

NSControl
The delegate of an NSControl should be able to access
validated values 
with objectValue in -controlTextDidChange:(NSNotification
*)obj (at 
least that's the behavior on MacOSX).

- (void)textDidChange: (NSNotification *)aNotification
{
   NSMutableDictionary *dict;

    [self validateEditing];  // <---------------- add
this

   dict = [[NSMutableDictionary alloc] initWithDictionary:
				     [aNotification userInfo]];
   [dict setObject: [aNotification object] forKey: "NSFieldEditor"];

   [nc postNotificationName:
NSControlTextDidChangeNotification
       object: self
       userInfo: dict];
   RELEASE(dict);
}

Regards,

   Andreas

_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustepgnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Re: NSControl fix
country flaguser name
Germany
2007-08-30 09:02:38
Andreas Höschler wrote:
> Hi all,
> 
> *NSControl*
> The delegate of an NSControl should be able to access
validated values
> with objectValue in
-controlTextDidChange:(NSNotification *)obj (at
> least that's the behavior on MacOSX).
> 
> - (void)textDidChange: (NSNotification *)aNotification
> {
> NSMutableDictionary *dict;
> 
> [self validateEditing]; // <---------------- add
this
> 
> 
> dict = [[NSMutableDictionary alloc]
initWithDictionary:
> [aNotification userInfo]];
> [dict setObject: [aNotification object] forKey: "NSFieldEditor"];
> 
> [nc postNotificationName:
NSControlTextDidChangeNotification
> object: self
> userInfo: dict];
> RELEASE(dict);
> }
> 

I still think this patch, which you did propose before is
wrong. We
should do the validation when accessing the value of the
cell. According
to the specification this gets done in NSActionCell for int,
float and
string values, but not for the object value itself.
Which specific subclass of NSCell are you using? Perhaps
the
implementation of this class is wrong.

Fred


_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustepgnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )