• 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
Separation of TextFieldCell and TextField subclasses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Separation of TextFieldCell and TextField subclasses


  • Subject: Separation of TextFieldCell and TextField subclasses
  • From: Prachi Gauriar <email@hidden>
  • Date: Fri, 21 Mar 2003 11:42:10 -0600

Hi. I'm working on a subclass of NSTextFieldCell and NSTextField to work like the search text fields in Mail or Safari for academic purposes. I've seen other implementations of these, but I really wanted to write one myself with a proper separation of the cell and control objects. I was thinking of implementing them as follows:

SearchTextFieldCell
Subclasses NSTextFieldCell and implements methods regarding the text editing itself, like -resetCursorRects, -drawInFrame:withView:, etc. I'd like it to be completely independent of SearchTextField.

SearchTextField
Contains SearchTextFieldCell, an NSButtonCell (for the cancel button), and an NSPopupButtonCell (for the magnifying glass and its menu). This is what the programmer would interface with. Also, this object would handle the placement and drawing of the SearchTextFieldCell, NSButtonCell, and NSPopupButtonCell. I think I'll probably have delegate methods that perform the search and/or cancel methods.

Does this seem like a good approach? I've never written a UI widget that actually was separated into a cell and an actual object, and I wanted to get it right. Any help would be appreciated.

Prachi Gauriar

Computer Engineering Major/Mathematics Minor
University of Arkansas
Email: email@hidden
Web Site: http://comp.uark.edu/~pgauria/
Public Key: http://homepage.mac.com/gallenx/88E3D706.gpgkey
_______________________________________________
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.

  • Follow-Ups:
    • Re: Separation of TextFieldCell and TextField subclasses
      • From: Stéphane Sudre <email@hidden>
  • Prev by Date: Re: Can't cache image
  • Next by Date: Re: Can't cache image
  • Previous by thread: Re: Can't cache image
  • Next by thread: Re: Separation of TextFieldCell and TextField subclasses
  • Index(es):
    • Date
    • Thread