[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how?

From: Nicolas SANCHEZ
Subject: Re: how?
Date: Wed, 04 Feb 2004 21:20:14 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4

reuss wrote:
Thanks for the advice. I did something similar with focus lost and I
could not find any solution until today.
On Wed, 04 Feb 2004 11:00:46 +0100, Nicolas SANCHEZ wrote:

euss 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

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]]];


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)

Maybe you can ask for your question in the gnu.gnustep.discuss newsgroup.

I always ask for devel problems in this group.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]