PyObjC
Sections:
Home
Documentation
Development
Download
Examples
Mailing lists
Navigation:
- AddressBook
- Automator
- CalendarStore
- Cocoa
- CoreData
- InstallerPlugins
- InstantMessage
- PreferencePanes
- Quartz
- ScreenSaver
- SearchKit
- WebKit
 

We're hosted on:
SourceForge.net Logo

Subversion hosting

Examples for Cocoa

ClassBrowser

A simple class browser, demonstrating the use of NSBrowser (a "column view" hierarchical widget) and NSTableView.

CurrencyConverter

A simple NIB based application. Start with this one. Also see the PyObjC tutorial.

DatePicker

"DatePicker" is a Cocoa sample application that demonstrates how to use NSDatePicker control on Mac OS X. NSDatePicker is a subclass of NSControl that provides for visually displaying and editing an NSDate instance.

DotView

A simple one-window demo showing how to custom drawing in a custom NSView. Additionally shows how easy it is to embed a view in an NSScrollView, as well as how to use an NSColorWell.

DragItemAround

Port to python of the DragItemAround example at ADC.

FieldGraph

This shows an simple example of an MVC based application, that also makes use of NSBezierPaths.

The application calculates the field pattern and RMS field of an antenna array with up to three elements.

Formatter

This example shows how to implement an NSFormatter subclass in Python.

Grady

This example shows how to use NSGradient.

HotKeyPython

Demonstrates how to use Carbon global hot keys from a PyObjC application. Also demonstrates how to use a NSApplication subclass.

iClass

A more elaborate class browser; demonstrates NSOutlineView and NSTableView.

PackageManager

An implementation of the MacPython PackageManager application using Cocoa.

PredicateEditorSample

"PredicateEditorSample" is a Cocoa application that demonstrates how to use the NSPredicateEditor class. The NSPredicateEditor class is a subclass of NSRuleEditor that is specialized for editing NSPredicate objects. This sample is intended to show how to use the many different features and aspects of this control and leverages Spotlight to search your Address Book.

PyInterpreter

A full featured embedded Python interpreter. This demonstrates more complicated uses of NSTextView, manual event dispatching, and the new text completion feature of OS X 10.3.

PyObjCLauncher

A reimplementation of the Python script launcher helper application in PyObjC.

PythonBrowser

A reusable Python object browser, demonstrating the use of NSOutlineView as well as how to use an NSWindowController subclass to create a window from a menu action.

RoundTransparentWindow

Port of the RoundTransparentWindow example at ADC.

SimpleService

Shows how to implement entries for the Services menu.

TableModel

A basic demo that shows how to use an NSTableView.

TinyTinyEdit

A minimal document-based text editor application.

TinyURLService

Another simple service, this one converts URL or strings from the pasteboard to tinyurl.com equivalents.

Todo

A more complex NIB based applications. This is a document-based application.

The code is a translation into Python of an example project in Learning Cocoa from O'Reilly

WebServicesTool

Queries an XML-RPC enabled web server for the methods that it implements. Demonstrates a more advanced use of an NSTableView, how to make a toolbar as well as how to use multi-threading.

Bookmarks

Shows custom array controller that implements table view data source methods to support drag and drop, including copying objects from one window to another, drop of URLs, and re-ordering of the content array.

Originally from Cocoa Bindings Examples and Hints, converted to PyObjC by u.fiedler.

ControlledPreferences

Demonstrates how to use Cocoa Bindings to simplify storing and retrieving user preferences. Also demonstrates how to use an NSValueTransformer to archive/unarchive a non-property-list type automatically (NSColor, in this case).

Originally from Cocoa Bindings Examples and Hints, converted to PyObjC by u.fiedler.

CurrencyConvBinding

A rewrite of CurrencyConverter using Cocoa Bindings.

Originally from Introduction to Developing Cocoa Applications Using Bindings, converted to PyObjC by u.fiedler.

FilteringController

Demonstrates how to subclass NSArrayController to implement filtering of a NSTableView. Also demonstrates the use of indexed accessors.

Originally from Cocoa Bindings Examples and Hints, converted to PyObjC by u.fiedler.

GraphicsBindings

Shows the use of a custom controller, a value transformer, and two custom bindings-enabled views. One view is a control that allows you to set the angle and offset of a shadow; the other view observes and displays a collection of graphic objects.

Originally from Cocoa Bindings Examples and Hints, converted to PyObjC by u.fiedler.

ManualBindings

A simple example that illustrates establishing bindings programmatically, including a number of options such as validation and an array operator, and indexed accessor methods. A custom model object implements custom validation method.

Originally from Cocoa Bindings Examples and Hints, converted to PyObjC by u.fiedler.

MutableTableModel

A mutable NSTableView using Cocoa Bindings.

TableModel

Shows how to fill an NSTableView using Key-Value Coding.

TableModelWithSearch

A more advanced example of Key-Value Coding. This uses a custom NSArrayController.

TemperatureTransformer

An example that uses NSValueTransformer to convert between Celsius and Fahrenheit.

Based on Apple's Value Transformers documentation, converted to PyObjC by u.fiedler.

ToDos

Shows two array controllers, one to manage the contents of a table view, the other to manage a pop-up menu in a table column. Also shows two value transformers to alter the color of text.

Originally from Cocoa Bindings Examples and Hints, converted to PyObjC by u.fiedler.

IDNSnitch

A proof of concept IDN spoofing defense for Safari (tested with v1.2.4 on Mac OS X 10.3.8). Demonstrates how to write an application that detects the launch of another application by bundle identifier, how to use objc.inject to load code into another application, how to override the implementation of an existing class but still call back into the original implementation, and how to reduce the size of such an application/plugin combination by using symlinks to share object files (the PyObjC extensions in this case).

InjectBrowser

Shows how to inject an in-process Python class browser into another process. Based on the AppKit ClassBrowser example.

InjectInterpreter

Shows how to inject an in-process Python interpreter into another process. Based on the AppKit PyInterpreter example.

OpenGLDemo

A simple program that shows how to use OpenGL in a Cocoa program. It is a port of Apple's "CocoaGL" example.

WebServicesTool

This is a refactor of the WebServicesTool example that is made much simpler and faster by using Twisted.

WebServicesTool-CocoaBindings

This is an even simpler refactor of the Twisted WebServicesTool example that uses Cocoa Bindings to remove a lot of the UI related code.

Copyright © 2003 - 2008 The PyObjC Project