New Apple sample code - Custom Control
New Apple sample code - Custom Control
- Subject: New Apple sample code - Custom Control
- From: Scott Anguish <email@hidden>
- Date: Fri, 28 Feb 2003 22:29:00 -0500
A new sample code application has been released - Custom Controls
This isn't entirely new, it was used in a WWDC 2002 presentation, and
has been available via ADC for WWDC attendees. It's now available for
everyone! I strongly recommend looking at this if you're wanting to
make your own control subclass.
http://developer.apple.com/samplecode/Sample_Code/Cocoa/
Clock_Control.htm
Abstract
In this sample we demonstrate how to create a custom control by
creating a clock control.
The clock control is implemented as a subclass of NSControl and
NSCell, ClockControl
and ClockCell respectively. Most of the work is done in the cell.
Because the cell handles
all of the work, we are able to demonstrate use of this cell in a
NSMatrix, NSTableView,
and it's native control, ClockControl.
Readme
Clock Control Sample Code
Overview:
In this sample we demonstrate how to create a custom control by
creating a clock control. The clock control is implemented as a
subclass of NSControl and NSCell, ClockControl and ClockCell
respectively. Most of the work is done in the cell. Because the cell
handles all of the work, we are able to demonstrate use of this cell in
a NSMatrix, NSTableView, and it's native control, ClockControl.
The code demonstrates many things, including:
Making your own control
- How to implement a control as a NSControl & NSCell pair.
- Drawing and tracking the mouse in a NSCell.
- Drawing a custom focus ring.
- Handling standard keyboard actions.
Using NSTableView
- Using an NSTableView.
- Using a custom cell in a NSTableView.
Misc
- How to make a simple palette.
- How to use keyed coding.
- Using localized strings
- Making your highly customized control accessible (often you get
this for free)
- more....
Important notes:
- This application can only be built on Jaguar systems. In
particular, it uses Accessibility, and Keyed Coding API that only exist
on Jaguar systems.
- Before you can open the Application's MainMenu.nib file, you will
have to build and launch IB by double clicking on the built palette.
(The nib requires this palette to be known and present)
_______________________________________________
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.