Skip navigation.
 
mlRe: I need help on simple Sketch app and Cocoa bindings
FROM : George Orthwein
DATE : Sat Jul 01 18:42:52 2006

I remember wanting to do something similar when I was starting out. 
Problem is, it can quickly get complex... especially if you involve 
bindings.

You'll need to set up a custom view to draw in and receive mouse 
events. Most of the starter books should cover this... I know 
Hillegass's does.

Definitely check out Graphics Bindings on mmalc's page:
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html

As noted, it's the most complicated example and will take quite a bit 
of time to fully understand. The difficulty is primarily in adding 
bindings support for a custom view... though there is now also a nice 
step through of that here (Bindings in More Detail):
http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaBindings/Concepts/HowDoBindingsWork.html#//apple_ref/doc/uid/
20002373-194182

So I would consider instead using normal target-action/outlets 
between your custom view and controller and not worry about making 
the custom view bindings-enabled. At least to start. You can still 
use bindings other places like between the textfields and controller, 
and between controller and model. I just remember jumping into the 
Graphics Bindings example a little too early myself. :)

More info on these topics:
http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaFundamentals/CocoaDesignPatterns/chapter_5_section_4.html
http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_1.html
http://developer.apple.com/documentation/Cocoa/Conceptual/
CocoaDrawingGuide/index.html
http://developer.apple.com/documentation/Cocoa/Conceptual/
CurrencyConverterBindings/index.html

Hope that helps,
George

Related mailsAuthorDate
mlI need help on simple Sketch app and Cocoa bindings CoLo0LoGo Jun 30, 21:03
mlRe: I need help on simple Sketch app and Cocoa bindings George Orthwein Jul 1, 18:42