discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSTextField (again)


From: Stefan Böhringer
Subject: Re: NSTextField (again)
Date: 16 Sep 2002 17:51:11 +0200

Indeed this is not the GNUstep/OPENSTEP way. Usually you have a delegate
for complex GUI-Objects, which is an instance variable that represents a
generic object which is informed or consulted on certain incidents.

E.g. a NSTextField allows for a delegate. The delegate object is sent a
control:textShouldBeginEditing: method (if implemented) whenever editing
might start due to mouse, keyboard or programmatic action. By returning
a boolean value you also have the option to deny firstResponder status
to the textfield (in the MVC paradigm a delegate is in the control
part).

Good documentation is available at the well known place:
http://developer.apple.com/techpubs/macosx/Cocoa/CocoaTopics.html

Hope the help,

        Stefan

On Mon, 2002-09-16 at 14:09, Dirk Lattermann wrote:
> Hello!
> 
> I investigated a bit more into my NSTextField problem mentioned in
> my last posting some days ago.
> 
> I figured out that I can subclass NSTextField overriding the
> becomeFirstResponder: message of NSResponder. This works, the
> message is invoked when I click into the text field.
> Is this the best/only way to achieve this? In other words,
> do I have to subclass NSTextField when I want to be notified
> if someone clicks on it?
> 
> I experimented with setAction:, but the action message is sent
> to the target only when the return key is pressed, regardless of
> what I set with sendActionOn:.
> 
> I am completely puzzled.
> 
> On top of that, is it a known bug that the NSTextField's delegate
> doesn't receive the control: textShouldBeginEditing: message?
> 
> Please, can someone shed some light on this? Thank you very much.
> 
> Dirk Lattermann
> 
> 
> _______________________________________________
> Discuss-gnustep mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/discuss-gnustep
> 
-- 
Stefan Böhringer                                Tel. +49 201 723 4681
University Clinics Essen                        Fax. +49 201 723 5900
Hufelandstr. 55                        address@hidden
45122 Essen, Germany  http://homepage.uni-bochum.de/stefan.boehringer





reply via email to

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