reuss wrote:
how do I connect a textfield to a textview? I dont really understand how
it should work, you know, I am a beginner (absolutely)
andras

I don't know if it's the best method (I'm new to GNUstep too) but it works.


Create delegate object to your NSTextField and implements controlTextDidChange like this :

(here textField is your NSTextField and you must have called [textField setDelegate: anObject] where anObject have the next method)

-(void) controlTextDidChange: (id)sender
{
  NSAutoreleasePool *pool = [NSAutoreleasePool new];

if ([[textField stringValue] length] > 10)
{
[textField setStringValue: [NSString stringWithString: [[textField stringValue] substringToIndex: 10]]];
}


  RELEASE(pool);
}

The problem when you use this is that when the number of letters exceed 10, the focus is lost by the textField. (I'm looking for a solution).
_______________________________________________
Help-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-gnustep

Reply via email to