• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: clickable text fields?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clickable text fields?


  • Subject: Re: clickable text fields?
  • From: Henry McGilton <email@hidden>
  • Date: Sat, 10 Sep 2005 09:43:27 -0700


On Sep 10, 2005, at 9:20 AM, Roland Silver wrote:

I'll rephrase my question about "text thingys":

I want to be able to create at run-time a window which contains a scrollable array of NSTextFields, scrollable because there may be more text fields than will fit in the visible part of the window.
Each text field has a display rectangle, within which can be entered (and displayed) a single line of text (with attributes).
If the window has focus, then a mouse-click within one of the text fields should invoke a method (presumably via delegation or notification) with an arg that tells the method which text field was clicked in.
Is that possible?
I haven't been able to get that to work, even though aNSTextField seems (like an NSButton) to be a subclass of NSControl, and to have (again like NSButton) an associated cell class (NSTextFieldCell) which is a subclass of NSActionCell.


I have been able to get this to work with NSButtons rather than NSTextFields, but that seems -- gross.

Assuming you have some kind of controller object that would respond to delegate messages from the text fields:

o   create your text fields programmatically,

o   assign each created field a unique tag using the  -setTag
    method

o   make your controller object the delegate of the text field
    using the  –setDelegate  method

o   implement the  -controlTextDidBeginEditing  method defined
    in NSControl.

o   look into the other delegate methods as appropriate, and also
    look into  -setTarget  and  -setAction  methods.


Cheers, ........ Henry


===============================+============================ Henry McGilton, Boulevardier | Trilithon Software Objective-C/Java Composer | Seroia Research -------------------------------+---------------------------- mailto:email@hidden | http://www.trilithon.com | ===============================+============================

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >clickable text fields? (From: Roland Silver <email@hidden>)

  • Prev by Date: Re: NSView to NSBitmapRep Without an NSWindow?
  • Next by Date: Re: Core Data / Bindings Behavior
  • Previous by thread: clickable text fields?
  • Next by thread: Re: clickable text fields?
  • Index(es):
    • Date
    • Thread