RE: Determining if a NSTextField is selected....
RE: Determining if a NSTextField is selected....
- Subject: RE: Determining if a NSTextField is selected....
- From: Guy Jonathan <email@hidden>
- Date: Fri, 31 Jan 2003 11:05:34 -0000
What you can do is subclass NSTextField adding a "stepper" IBOutlet. Then
just connect each textfield to the stepper in interface builder and override
your subclasses mouseDown event method to set the steppers target to self.
Followed by a call to the supers mouseDown method.
i.e. in your subclass
- (void)mouseDown:(NSEvent *)event
{
[stepper setTarget:self];
[super mouseDown:event];
}
Then all your stepper actions will be sent to your textfield.
Hope this helps.
Jonathan Guy
-----Original Message-----
From: Kevin Elliott [
mailto:email@hidden]
Sent: 31 January 2003 00:15
To: email@hidden
Subject: Determining if a NSTextField is selected....
Greetings all, I've got what sounds like a simple problem that I
haven't been able to figure out. I've got a window with number of
NSTextFields and an NSStepper in it. I'm trying to figure out is how
to determine which of those NSTextFields is currently "selected" (the
text is highlighted and/or it has the current cursor) inside the
NSSteppers action message. Nothing I've tried seems to work.
Neither NSTextField, nor it's super classes have an
"isActiveSelection" method. I've tried using NSTextField's "-
(BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText
*)fieldEditor"
and "- (BOOL)control:(NSControl *)control
textShouldEndEditing:(NSText *)fieldEditor
" to track which contol is active, but they don't seem to be called
for selection changes, only when actual input happens.
What am I missing?
--
__________________________________________
Kevin Elliott <
mailto:email@hidden>
ICQ#23758827 AIM ID: teargo
__________________________________________
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DISCLAIMER: The information in this email is confidential. The contents may
not be disclosed or used by anyone other than the addressee. If you are not
the intended recipient(s), any use, disclosure, copying, distribution or any
action taken or omitted to be taken in reliance on it is prohibited and may
be unlawful. If you have received this communication in error please notify
us by e-mail or by telephone on +44 (0) 20 7779 8888 and then delete the
e-mail and all attachments and any copies thereof.
Euromoney Institutional Investor PLC (its subsidiaries and associates)
cannot accept responsibility for the accuracy or completeness of this email
as it has been transmitted over a public network. If you suspect that the
email may have been intercepted or amended, please call the sender. Any
views expressed by an individual in this email do not necessarily reflect
views of Euromoney Institutional Investor PLC (its subsidiaries and
associates). This communication is from Euromoney Institutional Investor
PLC, a company registered in England and Wales under company number 954730
with registered office at Nestor House, Playhouse Yard, London EC4V 5EX.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.