Introduction to Control and Cell Programming Topics for Cocoa
Controls and cells implement user-interface objects, like buttons, text fields, and sliders.
This topic contains these subtopics:
A user interface object that sends an action message to a target when clicked.
Image View Programming Topics
A user interface object that displays a single image in a frame, and optionally allow a user to drag an image to it.
A user interface object that displays a range of values and has an indicator, or knob, which indicates the current setting.
A user interface object that displays text that the user can select or edit.
A user interface object that can draw a border around itself and title itself.
A user interface object that shows that a lengthy task is under way.
A user interface object that displays a collection of items that provide interaction with or feedback to the user.
Provides a user interface for displaying and selecting items from a list of data or from hierarchically organized lists of data, such as directory paths.
A user interface object used for creating groups of cells that work together in various ways.
A group of related text fields.
A user interface object that gives the user two ways to enter a value: entering it directly in a text field, or choosing it from a pop-up list of pre-selected values.
A user interface object that displays data for a set of related records, with rows representing individual records and columns representing the attributes of those records.
A user interface object providing a convenient way to provide information in multiple pages.
A type of table which lets the user expand or collapse rows containing hierarchical data.
Text views are the main user interface objects of the Cocoa text system.
A user interface object consisting of two small arrows that can increment and decrement a value that appears beside it, such as a date or time.
A user interface object that provides a standard user interface for searching.
A user interface object that has the appearance and behavior of a horizontal button divided into multiple segments.
Organization of This Document
Controls and cells implement user-interface objects, like buttons, text fields, and sliders. The control is responsible for
Intercepting user events (such as a clicking a button or moving a slider)
Sending actions to other objects, usually in response to a user event (such as changing a variable’s value as a slider moves or performing a command when a button is pressed.)
A control usually delegates the first two responsibilities to cells. Splitting these responsibilities off makes it easier to create a control with many identical elements (like a spreadsheet table) or with a few different elements (like a pull-down list that lets you enter a string either in a text field or from a menu of pre-elected strings).
Here are the concepts:
“About Cells and Controls” gives basic information on what the NSCell and NSControl classes do.
“How Controls and Cells Interact” gives more information on how controls and cells interact and how they operate.
“Cell States” describes the three states a control can have: on, off, or mixed. Although used primarily by NSButton, states are defined in NSCell so future subclasses can use them.
“Represented Objects” explains how to associate a cell with the object it represents.
Here are the tasks:
"“Manipulating Cells and Controls”" discusses various tips and techniques for dealing with cells and controls.
“Changing the Cell for a Control” describes how to change the NSCell subclass that a control uses.
“Displaying Cell Values” describes how some cells format and display their values as strings.
“Validating Control Entries” describes how to validate the contents of some cells, especially cells in a matrix or text field.
“Using a Continuous Control” describes how to set up a control so it sends its action message repeatedly while being pressed.
“Using the System Control Tint” describes how to use the system-wide control tint in your custom views and control cells.