Source

pyobjc / Examples / 00ReadMe.html

The branch 'pyobjc-ancient' does not exist.
Full commit
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
PyObjC Examples</title>
</head>
<body>
<h2>PyObjC Examples</h2>
<h2><a name="simple-scripts-that-demo-the-core-modules">Simple scripts that demo the core modules</a></h2>
<p>The directory <a href="Scripts">Scripts</a> contains a number of simple command-line scripts that make use
of Cocoa features.</p>
<ul>
<li><a href="Scripts/exportBook.py">exportBook.py</a><p>An example of using the AddressBook framework, this script exports some of the information
about people in your addressbook to a CSV file.</p>
</li>
</ul>
<ul>
<li><a href="Scripts/autoreadme.py">autoreadme.py</a><p>This script implements an autorun feature for Mac OS X: it will open the ReadMe file in
the root of every removable medium that is inserted when this script is running.</p>
</li>
</ul>
<ul>
<li>subclassing-objective-c.py<p>Create a subclass of an objective-C class</p>
</li>
<li>super-call.py<p>Likewise, but call super-class implementation of a method</p>
</li>
<li>dictionary.py<p>Use a NS*Dictionary object.</p>
</li>
<li>rendezvous.py<p>Use an NSNetService class to look for servers using rendezvous.</p>
</li>
</ul>
<h2><a name="cocoa-applications">Cocoa applications</a></h2>
<p>Most of the following examples contain a <code><span>buildapp.py</span></code> script that can
build an application. See <a href="../Doc/intro.html#building-applications">Building applications</a> for details how to invoke
these scripts. Some examples contain a <code><span>Project</span> <span>Builder</span></code> project file;
simply double-click it and choose <code><span>Build</span> <span>and</span> <span>Run</span></code>.</p>
<ul>
<li><a href="ClassBrowser">ClassBrowser</a><p>A simple class browser, demonstrating the use of NSBrowser (a &quot;column view&quot;
hierarchical widget) and NSTableView.</p>
</li>
<li>CocoaBindings<p>This directory contains a number of examples that make use of Key-Value Coding and
Cocoa Bindings. These scripts require Mac OS X 10.3 or later.</p>
<ul>
<li>TableModel<p>Shows how to fill an NSTableView using Key-Value Coding.</p>
</li>
<li>TableModelWithSearch<p>A more advanced example of Key-Value Coding. This uses a custom 
<code><span>NSArrayController</span></code>.</p>
</li>
</ul>
</li>
<li><a href="CurrencyConverter">CurrencyConverter</a><p>A simple NIB based application. Start with this one. Also see the PyObjC
tutorial.</p>
</li>
<li><a href="DotView">DotView</a><p>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.</p>
</li>
<li><a href="EnvironmentPrefs">EnvironmentPrefs</a><p>Another NSPreferencePane. This one can be used to edit the default environment
for the current user. It also is a simple example of a localized application.</p>
</li>
<li><a href="FieldGraph">FieldGraph</a><p>Another Project Builder Cocoa project, it also includes a <code><span>buildapp.py</span></code> 
script. This shows an simple example of an MVC based application, that also
makes use of NSBezierPaths.</p>
<p>The application calculates the field pattern and RMS field of an antenna 
array with up to three elements.</p>
</li>
<li><a href="iClass">iClass</a><p>A more elaborate class browser; demonstrates NSOutlineView and NSTableView.</p>
</li>
<li><a href="PrefPane">PrefPane</a><p>Demonstrates how to write an NSPreferencePane, for use in the
System Preferences application. Requires a framework build of Python.</p>
</li>
<li><a href="OpenGLDemo">OpenGLDemo</a><p>A simple program that shows how to use OpenGL in a Cocoa program.  It is a 
port of Apple's &quot;CocoaGL&quot; example.  Note that this requires <a href="http://pyopengl.sourceforge.net/">PyOpenGL</a> to 
be installed.</p>
</li>
<li><a href="PackageManager">PackageManager</a><p>An implementation of the MacPython PackageManager application using
Cocoa.</p>
</li>
<li><a href="PyDocURLProtocol">PyDocURLProtocol</a><p>This example implements a subclass of <code><span>NSURLProtocol</span></code> that can be used
to load the pydoc documentation of a module.</p>
<p>It also includes a simple documentation browser using <code><span>WebKit</span></code> and the 
<code><span>PyDocURLProtocol</span></code> class.</p>
</li>
<li><a href="PyInterpreter">PyInterpreter</a><p>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.</p>
</li>
<li><a href="PythonBrowser">PythonBrowser</a><p>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.</p>
</li>
<li><a href="SillyBallsSaver">SillyBallsSaver</a><p>A simple screensaver written in Python. This example requires a framework
install of Python, that is either Mac OS X 10.3 or a MacPython 2.3 
installation.</p>
</li>
<li><a href="SimpleService">SimpleService</a><p>Shows how to implement entries for the Services menu.</p>
</li>
<li><a href="TableModel">TableModel</a><p>Basic demo that shows how to use a NSTableView.</p>
</li>
<li><a href="TinyTinyEdit">TinyTinyEdit</a><p>A minimal Document-based text editor application.</p>
</li>
<li><a href="Todo">Todo</a><p>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</p>
</li>
<li><a href="Twisted">Twisted</a><p>This directory contains a number of examples that use <a href="http://www.twistedmatrix.com">Twisted (1.1 or later)</a> with
Cocoa.</p>
</li>
</ul>
<blockquote>
<ul>
<li>WebServicesTool<p>This is a refactor of the WebServicesTool example that is made much simpler
by using Twisted.</p>
</li>
<li>WebServicesTool-ControllerLayer<p>This is a refactor of the WebServicesTool example that is made much simpler
by using Twisted as it does not need threads. This version also uses
NSController and therefore requires Mac OS X 10.3.</p>
</li>
</ul>
</blockquote>
<ul>
<li><a href="WebServicesTool">WebServicesTool</a><p>Another Project Builder Cocoa project.  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.</p>
</li>
</ul>
<h2><a name="some-work-in-progress-examples">Some work-in-progress examples</a></h2>
<p>The directory <code><span>NonFunctional</span></code> contains a number of examples that are not working
for one reason or another. The most likely reason is that example relies on features
that have not yet been implemented.</p>
<ul>
<li><a href="NonFunctional/ProgressViewPalette">ProgressViewPalette</a><p>An example of a palette for Interface Builder. It is a straight port of an Apple
example with the same name.</p>
<p>This example does not work at the moment, due to an incompatibility between
PyObjC and the way IB looks for classes.</p>
</li>
</ul>
</body>
</html>