Bob Ippolito avatar Bob Ippolito committed 4295559

move some examples around

Comments (0)

Files changed (310)

pyobjc/Examples/AppKit/ClassBrowser/ClassBrowser.nib/classes.nib

+{
+    IBClasses = (
+        {
+            ACTIONS = {browserAction = id; }; 
+            CLASS = ClassBrowserDelegate; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {browser = id; pathLabel = id; table = id; }; 
+            SUPERCLASS = NSObject; 
+        }, 
+        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
+    ); 
+    IBVersion = 1; 
+}

pyobjc/Examples/AppKit/ClassBrowser/ClassBrowser.nib/info.nib

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>IBDocumentLocation</key>
+	<string>61 25 356 240 0 0 1152 746 </string>
+	<key>IBEditorPositions</key>
+	<dict>
+		<key>29</key>
+		<string>45 156 318 44 0 0 1152 746 </string>
+	</dict>
+	<key>IBFramework Version</key>
+	<string>291.0</string>
+	<key>IBOpenObjects</key>
+	<array>
+		<integer>21</integer>
+		<integer>29</integer>
+	</array>
+	<key>IBSystem Version</key>
+	<string>6L60</string>
+</dict>
+</plist>
Add a comment to this file

pyobjc/Examples/AppKit/ClassBrowser/ClassBrowser.nib/objects.nib

Binary file added.

pyobjc/Examples/AppKit/ClassBrowser/ClassBrowser.py

+"""ClassBrowser.py -- A simple class browser, demonstrating the use of an NSBrowser.
+
+To build the demo program, run this line in Terminal.app:
+
+    $ python setup.py py2app -A
+
+This creates a directory "dist" containing ClassBrowser.app. (The
+-A option causes the files to be symlinked to the .app bundle instead
+of copied. This means you don't have to rebuild the app if you edit the
+sources or nibs.)
+
+See also the iClass demo.
+"""
+
+from PyObjCTools import NibClassBuilder, AppHelper
+from objc import getClassList, objc_object
+
+
+try:
+    import AddressBook
+except ImportError:
+    pass
+
+try:
+    import PreferencePanes
+except ImportError:
+    pass
+
+try:
+    import InterfaceBuilder
+except ImportError:
+    pass
+
+
+NibClassBuilder.extractClasses("ClassBrowser")
+
+
+def _sortClasses(classList):
+    classes = [(cls.__name__, cls) for cls in classList]
+    classes.sort()
+    return [cls for name, cls in classes]
+
+
+# class defined in ClassBrowser.nib
+class ClassBrowserDelegate(NibClassBuilder.AutoBaseClass):
+    # the actual base class is NSObject
+    # The following outlets are added to the class:
+    # browser
+    # pathLabel
+    # table
+
+    selectedClassMethods = None
+
+    def awakeFromNib(self):
+        classes = getClassList()
+        rootClasses = []
+        for cls in classes:
+            if cls.__base__ == objc_object:
+                rootClasses.append(cls)
+        rootClasses = _sortClasses(rootClasses)
+        self.columns = [rootClasses]
+        self.browser.setMaxVisibleColumns_(7)
+        self.browser.setMinColumnWidth_(150)
+        self.selectedClass = None
+        self.selectedClassMethods = None
+
+    def browser_willDisplayCell_atRow_column_(self, browser, cell, row, col):
+        cell.setLeaf_(not self.columns[col][row].__subclasses__())
+        cell.setStringValue_(self.columns[col][row].__name__)
+
+    def browser_numberOfRowsInColumn_(self, browser, col):
+        if col == 0:
+            return len(self.columns[0])
+        del self.columns[col:]
+        cls = self.columns[col - 1][browser.selectedRowInColumn_(col - 1)]
+        subclasses = _sortClasses(cls.__subclasses__())
+        self.columns.append(subclasses)
+        return len(subclasses)
+
+    # action method, called when the user clicks somewhere in the browser
+    def browserAction_(self, browser):
+        self.pathLabel.setStringValue_(browser.path())
+
+        self.selectedClass = None
+        self.selectedClassMethods = None
+        col = len(self.columns)
+        row = -1
+        while row == -1:
+            col -= 1
+            if col < 0:
+                break
+            row = self.browser.selectedRowInColumn_(col)
+        if row >= 0:
+            self.selectedClass = self.columns[col][row]
+            # Classes get initialized lazily, upon the first attribute access,
+            # only after that cls.__dict__ actually contains the methods.
+            # Do a dummy hasattr() to make sure the class is initialized.
+            hasattr(self.selectedClass, "alloc")
+            self.selectedClassMethods = [obj.selector for obj in self.selectedClass.__dict__.values()
+                                         if hasattr(obj, "selector")]
+            self.selectedClassMethods.sort()
+
+        self.table.reloadData()
+
+    # table view delegate methods
+    def numberOfRowsInTableView_(self, tableView):
+        if self.selectedClassMethods is None:
+            return 0
+        return len(self.selectedClassMethods)
+
+    def tableView_objectValueForTableColumn_row_(self, tableView, col, row):
+        return str(self.selectedClassMethods[row])
+
+    def tableView_shouldEditTableColumn_row_(self, tableView, col, row):
+        return 0
+
+
+if __name__ == "__main__":
+    AppHelper.runEventLoop()

pyobjc/Examples/AppKit/ClassBrowser/setup.py

+"""
+Script for building the example.
+
+Usage:
+    python setup.py py2app
+""" 
+from distutils.core import setup
+import py2app
+
+plist = dict(NSMainNibFile="ClassBrowser")
+setup(
+    app=["ClassBrowser.py"],
+    data_files=["ClassBrowser.nib"],
+    options=dict(py2app=dict(plist=plist)),
+)

pyobjc/Examples/AppKit/CurrencyConverter/00README.txt

+==================
+Currency Converter
+==================
+
+:author: Ronald Oussoren
+:contact: ronaldoussoren@mac.com
+
+.. contents:
+
+Introduction
+------------
+
+This is a port of the `Currency Converter`_ example from the Cocoa tutorial
+to Python (via PyObjC).  Development is done in "standalone" mode.  That is,
+the buildapp.py script is used to build an application wrapper that can be
+launched like any other Cocoa application.
+
+Building the App
+----------------
+
+To build the app, invoke the buildapp.py script::
+
+   python buildapp.py build
+
+This will build the CurrencyConverter application in the directory build
+within the current working directory as *CurrencyConverter.app*.
+
+.. _`Currency Converter`: file:///Developer/Documentation/Cocoa/ObjCTutorial/index.html 

pyobjc/Examples/AppKit/CurrencyConverter/CurrencyConverter.py

+import time
+import sys
+from Foundation import NSObject
+from AppKit import NSApplicationMain
+from PyObjCTools import NibClassBuilder
+from AppKit import NSRunAlertPanel
+from objc import *
+
+NibClassBuilder.extractClasses('MainMenu.nib')
+
+class Converter (NibClassBuilder.AutoBaseClass):
+    def convertAmount(self, amt, rate):
+        return amt*rate
+
+
+class ConverterController (NibClassBuilder.AutoBaseClass):
+
+    # First define the IB Outlets, the 'ivar' calls below define new
+    # instance variables in the objective-C class (e.g. visible
+    # for introspection in objective-C)
+
+    def awakeFromNib(self):
+        # Provide some defaults for the user...
+        self.dollarField.setFloatValue_(2.0)
+        self.rateField.setFloatValue_(3.0)
+
+    def convert_(self, sender):
+        rate = self.rateField.floatValue()
+        amt = self.dollarField.floatValue()
+
+        total = self.converter.convertAmount(rate, amt)
+        self.totalField.setFloatValue_(total)
+        self.rateField.selectText_(self)
+
+        x = NSRunAlertPanel("Calculation Result",
+            "The result is %s"%(total), "OK", None, None)
+
+
+sys.exit(NSApplicationMain(sys.argv))
Add a comment to this file

pyobjc/Examples/AppKit/CurrencyConverter/English.lproj/InfoPlist.strings

Binary file added.

pyobjc/Examples/AppKit/CurrencyConverter/English.lproj/MainMenu.nib/classes.nib

+{
+    IBClasses = (
+        {CLASS = Converter; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 
+        {
+            ACTIONS = {convert = id; }; 
+            CLASS = ConverterController; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {converter = id; dollarField = id; rateField = id; totalField = id; }; 
+            SUPERCLASS = NSObject; 
+        }, 
+        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
+    ); 
+    IBVersion = 1; 
+}

pyobjc/Examples/AppKit/CurrencyConverter/English.lproj/MainMenu.nib/info.nib

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
+<plist version="0.9">
+<dict>
+	<key>IBDocumentLocation</key>
+	<string>34 73 356 240 0 0 800 578 </string>
+	<key>IBEditorPositions</key>
+	<dict>
+		<key>29</key>
+		<string>26 119 318 44 0 0 800 578 </string>
+	</dict>
+	<key>IBFramework Version</key>
+	<string>263.2</string>
+	<key>IBOpenObjects</key>
+	<array>
+		<integer>21</integer>
+		<integer>29</integer>
+	</array>
+	<key>IBSystem Version</key>
+	<string>5Q125</string>
+</dict>
+</plist>
Add a comment to this file

pyobjc/Examples/AppKit/CurrencyConverter/English.lproj/MainMenu.nib/objects.nib

Binary file added.

pyobjc/Examples/AppKit/CurrencyConverter/setup.py

+"""
+Script for building the example.
+
+Usage:
+    python setup.py py2app
+"""
+from distutils.core import setup
+import py2app
+
+setup(
+    app=["CurrencyConverter.py"],
+    data_files=["English.lproj"],
+)

pyobjc/Examples/AppKit/DotView/DotView.py

+"""DotView.py -- A one-window app demonstrating how to write a custom NSView.
+
+To build the demo program, run this line in Terminal.app:
+
+    $ python setup.py py2app -A
+
+This creates a directory "dist" containing DotView.app. (The
+-A option causes the files to be symlinked to the .app bundle instead
+of copied. This means you don't have to rebuild the app if you edit the
+sources or nibs.)
+"""
+
+# Created by Etienne Posthumus on Thu Dec 26 2002, after Apple's
+# ObjC DotView example.
+# Edited and enhanced by JvR, 2003.
+#
+# The main difference with the Apple DotView demo is that our custom view
+# is embedded in a scroll view. It turns out that this is almost no work
+# in InterfaceBuilder (select the view, then go to Layout -> Make subvies of
+# -> Scroll View), and *no* work in the code. It was too easy, so for kicks
+# I added zoom functionality and a "Show rulers" checkbox.
+
+from AppKit import NSBezierPath, NSColor, NSRectFill
+from AppKit import NSCommandKeyMask
+from PyObjCTools import NibClassBuilder, AppHelper
+
+try:
+    True, False
+except NameError:
+    # True and False are not defined in Python before Python 2.2.1
+    True, False = 1, 0
+
+
+# create ObjC classes as defined in MainMenu.nib
+NibClassBuilder.extractClasses("MainMenu")
+
+
+ZOOM = 2.0
+
+
+# class defined in MainMenu.nib
+class DotView(NibClassBuilder.AutoBaseClass):
+    # the actual base class is NSView
+    # The following outlets are added to the class:
+    # colorWell
+    # sizeSlider
+
+    def initWithFrame_(self, frame):
+        self.center = (50.0, 50.0)
+        super(DotView, self).initWithFrame_(frame)
+        self.radius = 10.0
+        self.color = NSColor.redColor()
+        return self
+
+    def awakeFromNib(self):
+        self.colorWell.setColor_(self.color)
+        self.sizeSlider.setFloatValue_(self.radius)
+        scrollView = self.superview().superview()
+        scrollView.setHasHorizontalRuler_(1)
+        scrollView.setHasVerticalRuler_(1)
+
+    def zoomIn_(self, sender):
+        (x, y), (bw, bh) = self.bounds()
+        (x, y), (fw, fh) = self.frame()
+        self.setBoundsSize_((bw / ZOOM, bh / ZOOM))
+        self.setFrameSize_((fw * ZOOM, fh * ZOOM))
+        self.setNeedsDisplay_(True)
+
+    def zoomOut_(self, sender):
+        (x, y), (bw, bh) = self.bounds()
+        (x, y), (fw, fh) = self.frame()
+        self.setBoundsSize_((bw * ZOOM, bh * ZOOM))
+        self.setFrameSize_((fw / ZOOM, fh / ZOOM))
+        self.setNeedsDisplay_(True)
+
+    def setRulersVisible_(self, button):
+        scrollView = self.superview().superview()
+        scrollView.setRulersVisible_(button.state())
+
+    def isOpaque(self):
+        return True
+
+    def mouseDown_(self, event):
+        eventLocation = event.locationInWindow()
+        if event.modifierFlags() & NSCommandKeyMask:
+            clipView = self.superview()
+            self.originalPoint = eventLocation
+            self.originalOffset = clipView.bounds()[0]
+        else:
+            self.center = self.convertPoint_fromView_(eventLocation, None)
+            self.setNeedsDisplay_(True)
+            self.autoscroll_(event)
+
+    def mouseDragged_(self, event):
+        if event.modifierFlags() & NSCommandKeyMask:
+            clipView = self.superview()
+            eventLocation = event.locationInWindow()
+            ox, oy = self.originalPoint
+            x, y = eventLocation
+            dx, dy = x - ox, y - oy
+            x, y = self.originalOffset
+            ox, oy = clipView.constrainScrollPoint_((x - dx, y - dy))
+            clipView.scrollToPoint_((ox, oy))
+            clipView.superview().reflectScrolledClipView_(clipView)
+        else:
+            self.mouseDown_(event)
+
+    def drawRect_(self, rect):
+        NSColor.whiteColor().set()
+        NSRectFill(self.bounds())
+        origin = (self.center[0]-self.radius, self.center[1]-self.radius)
+        size = (2 * self.radius, 2 * self.radius)
+        dotRect = (origin, size)
+        self.color.set()
+        NSBezierPath.bezierPathWithOvalInRect_(dotRect).fill()
+
+    def setRadius_(self, sender):
+        self.radius = sender.floatValue()
+        self.setNeedsDisplay_(True)
+
+    def setColor_(self, sender):
+        self.color = sender.color()
+        self.setNeedsDisplay_(True)
+
+
+if __name__ == "__main__":
+    AppHelper.runEventLoop()

pyobjc/Examples/AppKit/DotView/English.lproj/MainMenu.nib/classes.nib

+{
+    IBClasses = (
+        {
+            ACTIONS = {
+                setColor = id; 
+                setRadius = id; 
+                setRulersVisible = id; 
+                zoomIn = id; 
+                zoomOut = id; 
+            }; 
+            CLASS = DotView; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {colorWell = NSColorWell; sizeSlider = NSSlider; }; 
+            SUPERCLASS = NSView; 
+        }, 
+        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
+    ); 
+    IBVersion = 1; 
+}

pyobjc/Examples/AppKit/DotView/English.lproj/MainMenu.nib/info.nib

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>IBDocumentLocation</key>
+	<string>214 37 397 320 0 0 1024 746 </string>
+	<key>IBEditorPositions</key>
+	<dict>
+		<key>29</key>
+		<string>14 337 130 44 0 0 1024 746 </string>
+	</dict>
+	<key>IBFramework Version</key>
+	<string>291.0</string>
+	<key>IBOpenObjects</key>
+	<array>
+		<integer>21</integer>
+	</array>
+	<key>IBSystem Version</key>
+	<string>6L60</string>
+</dict>
+</plist>
Add a comment to this file

pyobjc/Examples/AppKit/DotView/English.lproj/MainMenu.nib/objects.nib

Binary file added.

pyobjc/Examples/AppKit/DotView/setup.py

+"""
+Script for building the example.
+
+Usage:
+    python setup.py py2app
+"""
+from distutils.core import setup
+import py2app
+
+setup(
+    app=["DotView.py"],
+    data_files=["English.lproj"],
+)

pyobjc/Examples/AppKit/FieldGraph/CGraphController.py

+from Foundation import NSObject
+from PyObjCTools import NibClassBuilder, AppHelper
+from objc import *
+
+from CGraphModel import *
+from CGraphView import *
+from fieldMath import *
+
+
+NibClassBuilder.extractClasses("MainMenu")
+
+
+#____________________________________________________________
+class CGraphController(NibClassBuilder.AutoBaseClass):
+
+#____________________________________________________________
+# Update GUI display and control values
+
+    def awakeFromNib(self):
+        self.mapImage = NSImage.imageNamed_("Map")
+        self.graphView.setMapImage(self.mapImage)
+        self.drawGraph()
+
+    def drawGraph(self):
+        self.spacingDisplay.setFloatValue_(radToDeg(self.graphModel.getSpacing()))
+        self.spacingSlider.setFloatValue_(radToDeg(self.graphModel.getSpacing()))
+        self.fieldDisplay0.setFloatValue_(self.graphModel.getField(0))
+        self.fieldDisplay1.setFloatValue_(self.graphModel.getField(1))
+        self.fieldDisplay2.setFloatValue_(self.graphModel.getField(2))
+        self.fieldSlider0.setFloatValue_(self.graphModel.getField(0))
+        self.fieldSlider1.setFloatValue_(self.graphModel.getField(1))
+        self.fieldSlider2.setFloatValue_(self.graphModel.getField(2))
+        self.phaseDisplay0.setFloatValue_(radToDeg(self.graphModel.getPhase(0)))
+        self.phaseDisplay1.setFloatValue_(radToDeg(self.graphModel.getPhase(1)))
+        self.phaseDisplay2.setFloatValue_(radToDeg(self.graphModel.getPhase(2)))
+        self.phaseSlider0.setFloatValue_(radToDeg(self.graphModel.getPhase(0)))
+        self.phaseSlider1.setFloatValue_(radToDeg(self.graphModel.getPhase(1)))
+        self.phaseSlider2.setFloatValue_(radToDeg(self.graphModel.getPhase(2)))
+
+        totalField = self.graphModel.getField(0) + self.graphModel.getField(1) + self.graphModel.getField(2)
+
+        RMSGain = self.graphModel.fieldGain()
+        self.graphView.setGain(RMSGain, totalField)
+        self.RMSGainDisplay.setFloatValue_(RMSGain*100.0)
+
+        path, maxMag  = self.graphModel.getGraph()
+        self.graphView.setPath(path, maxMag)
+
+
+#____________________________________________________________
+# Handle GUI values
+
+    def fieldDisplay0_(self, sender):
+        self.setNormalizedField(0, sender.floatValue())
+        self.drawGraph()
+
+    def fieldDisplay1_(self, sender):
+        self.setNormalizedField(1, sender.floatValue())
+        self.drawGraph()
+
+    def fieldDisplay2_(self, sender):
+        self.setNormalizedField(2, sender.floatValue())
+        self.drawGraph()
+
+    def fieldSlider0_(self, sender):
+        self.setNormalizedField(0, sender.floatValue())
+        self.drawGraph()
+
+    def fieldSlider1_(self, sender):
+        self.setNormalizedField(1, sender.floatValue())
+        self.drawGraph()
+
+    def fieldSlider2_(self, sender):
+        self.setNormalizedField(2, sender.floatValue())
+        self.drawGraph()
+
+    def setNormalizedField(self, t, v):
+        if self.fieldNormalizeCheck.intValue():
+            f = [0, 0, 0]
+            cft = 0
+            for i in range(3):
+                f[i] = self.graphModel.getField(i)
+                cft += f[i]
+
+            aft = cft - v
+            if aft < 0.001:
+                v = cft - 0.001
+                aft = 0.001
+            f[t] = v
+
+            nft = 0
+            for i in range(3):
+                nft +=  f[i]
+            r = aft / (nft - f[t])
+
+            for i in range(3):
+                self.graphModel.setField(i, f[i] * r)
+            self.graphModel.setField(t, v)
+
+        else:
+            self.graphModel.setField(t, v)
+
+
+
+    def phaseDisplay0_(self, sender):
+        self.graphModel.setPhase(0, degToRad(sender.floatValue()))
+        self.drawGraph()
+
+    def phaseDisplay1_(self, sender):
+        self.graphModel.setPhase(1, degToRad(sender.floatValue()))
+        self.drawGraph()
+
+    def phaseDisplay2_(self, sender):
+        self.graphModel.setPhase(2, degToRad(sender.floatValue()))
+        self.drawGraph()
+
+    def phaseSlider0_(self, sender):
+        self.graphModel.setPhase(0, degToRad(sender.floatValue()))
+        self.drawGraph()
+
+    def phaseSlider1_(self, sender):
+        self.graphModel.setPhase(1, degToRad(sender.floatValue()))
+        self.drawGraph()
+
+    def phaseSlider2_(self, sender):
+        self.graphModel.setPhase(2, degToRad(sender.floatValue()))
+        self.drawGraph()
+
+    def spacingDisplay_(self, sender):
+        self.graphModel.setSpacing(degToRad(sender.floatValue()))
+        self.drawGraph()
+
+    def spacingSlider_(self, sender):
+        self.graphModel.setSpacing(degToRad(sender.floatValue()))
+        self.drawGraph()
+
+    def settingDrawerButton_(self, sender):
+        self.settingDrawer.toggle_(self)

pyobjc/Examples/AppKit/FieldGraph/CGraphModel.py

+from Foundation import NSObject
+from PyObjCTools import NibClassBuilder
+from objc import *
+from AppKit import NSBezierPath
+
+from fieldMath import *
+
+#____________________________________________________________
+class CGraphModel(NibClassBuilder.AutoBaseClass):
+
+    def init(self):
+        self.field = [1.0, 1.12, 0.567]
+        self.phase = [degToRad(0), degToRad(152.6), degToRad(312.9-360)]
+        self.RMSGain = 0
+        self.spacing = degToRad(90)
+        return self
+
+    def getGraph(self):
+        path = NSBezierPath.bezierPath()
+
+        maxMag = 0
+        mag = self.fieldValue(0)
+
+        maxMag = max(maxMag, mag)
+        path.moveToPoint_(polarToRect((mag, 0)))
+        for deg in range(1, 359, 1):
+            r = (deg/180.0)*pi
+            mag = self.fieldValue(r)
+            maxMag = max(maxMag, mag)
+            path.lineToPoint_(polarToRect((mag, r)))
+        path.closePath()
+
+        return path, maxMag;
+
+    def fieldGain(self):
+        gain = 0
+        Et = self.field[0] + self.field[1] + self.field[2]
+        if Et:          # Don't want to divide by zero in the pathological case
+            spacing = [0, self.spacing, 2*self.spacing]
+
+            # This could easily be optimized--but this is just anexample :-)
+            for i in range(3):
+                for j in range(3):
+                    gain += self.field[i]*self.field[j] * cos(self.phase[j]-self.phase[i]) * bessel(spacing[j]-spacing[i])
+            gain = sqrt(gain) / Et
+
+        self.RMSGain = gain
+        return gain
+
+    def fieldValue(self, a):
+        # The intermedate values are used to more closely match standard field equations nomenclature
+        E0 = self.field[0]
+        E1 = self.field[1]
+        E2 = self.field[2]
+        B0 = self.phase[0]
+        B1 = self.phase[1] + self.spacing * cos(a)
+        B2 = self.phase[2] + 2 * self.spacing * cos(a)
+
+        phix = sin(B0) * E0  + sin(B1) * E1 + sin(B2) * E2
+        phiy = cos(B0) * E0 + cos(B1) * E1 + cos(B2) * E2
+        mag = hypot(phix, phiy)
+
+        return mag
+
+
+    def setField(self, tower, field):
+        self.field[tower] = field
+
+    def getField(self, tower):
+        return self.field[tower]
+
+    def setPhase(self, tower, phase):
+        self.phase[tower] = phase
+
+    def getPhase(self, tower):
+        return self.phase[tower]
+
+    def setSpacing(self, spacing):
+        self.spacing = spacing
+
+    def getSpacing(self):
+        return self.spacing

pyobjc/Examples/AppKit/FieldGraph/CGraphView.py

+from PyObjCTools import NibClassBuilder
+from Foundation import *
+from AppKit import *
+from math import pi, sin, cos
+from fieldMath import *
+
+# Convience global variables
+x, y = 0, 1
+llc, sze = 0, 1 # Left Lower Corner, Size
+
+#____________________________________________________________
+class CGraphView(NibClassBuilder.AutoBaseClass):
+
+    def initWithFrame_(self, frame):
+        super(CGraphView, self).initWithFrame_(frame)
+        self.setGridColor()
+        self.setRmsColor()
+        self.setGraphColor()
+        self.graphMargin = 2
+        self.mapImage = 0
+        self.mapRect = 0
+        self.mapVisible = 0.70
+        self.mapScale = 3.0
+        self.mapOffsetEW = 0.27
+        self.mapOffsetNS = 0.40
+        self.mapBaseRadius = 200
+
+        self.lines = 2
+        self.gain = 0.5
+        return self
+
+    def awakeFromNib(self):
+        self.setCrossCursor()
+        self.mapVisibleSlider.setFloatValue_(self.mapVisible)
+        self.setAzmuth(125)
+        self.setMapRect()
+
+    def setCrossCursor(self):
+        crosshairImage = NSImage.imageNamed_("CrossCursor")
+        imageSize = crosshairImage.size()
+        self.crossCursor = NSCursor.alloc().initWithImage_hotSpot_(crosshairImage, (8, 8))
+        rect = self.bounds()
+        self.trackingRect = self.addTrackingRect_owner_userData_assumeInside_(self.bounds(), self, 0, 0)
+
+    def setGridColor(self, color=NSColor.greenColor()):
+        self.gridColor = color
+
+    def setRmsColor(self, color=NSColor.blueColor()):
+        self.rmsColor = color
+
+    def setGraphColor(self, color=NSColor.blackColor()):
+        self.graphColor = color
+
+    def setGain(self, gain, total):
+        self.gain = gain
+        self.totalField = total
+
+    def setLines(self, lines):
+        self.lines = lines
+
+    def setMapImage(self, mapImage):
+        self.mapImage = mapImage
+        self.mapRect = ((0, 0), mapImage.size())
+
+    def setPath(self, path, maxMag):
+        self.path = path
+        self.maxMag = maxMag
+        self.setNeedsDisplay_(1)
+
+
+    def drawRect_(self, rect):
+        frame = self.frame()
+        self.origin = frame[0]
+        self.graphCenter = (frame[sze][x]/2, frame[sze][y]/2)
+        self.graphRadius = (min(frame[sze][x], frame[sze][y]) / 2) - self.graphMargin
+
+        NSColor.whiteColor().set()
+        NSRectFill(self.bounds())
+
+        self.drawMap()
+        self.drawGrid()
+        self.drawRMS()
+        self.drawField()
+
+    def drawMap(self):
+        if self.mapImage == 0:
+            return
+
+        scale = self.mapScale * (self.graphRadius / self.mapBaseRadius) * self.gain / self.totalField
+        xImageSize = scale * self.mapRect[sze][x]
+        yImageSize = scale * self.mapRect[sze][y]
+        xCenterMove = self.graphCenter[x] - self.graphRadius
+        yCenterMove = self.graphCenter[y] - self.graphRadius
+
+        xOffset = -((1 - self.mapOffsetEW) / 2) * xImageSize
+        yOffset = -((1 + self.mapOffsetNS) / 2) * yImageSize
+        xOffset += self.graphRadius + xCenterMove
+        yOffset += self.graphRadius + yCenterMove
+
+        drawInRect = ((xOffset, yOffset), (xImageSize, yImageSize))
+
+        self.mapImage.drawInRect_fromRect_operation_fraction_(drawInRect, self.mapRect, NSCompositeSourceOver, self.mapVisible)
+
+    def drawGrid(self):
+        self.gridColor.set()
+        self.drawCircle(1.0)
+        self.drawAxisLines()
+
+    def drawCircle(self, scale):
+        center = self.graphCenter
+        radius = self.graphRadius*scale
+        x, y = 0, 1
+        if radius >= 1:
+            dotRect = ((center[x]-radius, center[y]-radius), (2*radius, 2*radius))
+            path = NSBezierPath.bezierPathWithOvalInRect_(dotRect)
+            path.stroke()
+
+    def drawRMS(self):
+        self.rmsColor.set()
+        self.drawCircle(self.gain)
+
+    def drawAxisLines(self):
+        center = self.graphCenter
+        radius = self.graphRadius
+        x, y = 0, 1
+        path = NSBezierPath.bezierPath()
+        for i in range(1, self.lines+1):
+            iR = pi / i
+            cosR = cos(iR) * radius
+            sinR = sin(iR) * radius
+
+            path.moveToPoint_((center[x] - cosR, center[y] - sinR))
+            path.lineToPoint_((center[x] + cosR, center[y] + sinR))
+        path.closePath()
+        path.stroke()
+
+    def drawField(self):
+        if self.maxMag:         # Don't want to divide by zero in the pathological case
+            self.graphColor.set()
+            path = self.path.copy()
+
+            transform = NSAffineTransform.transform()
+            transform.rotateByRadians_(-(pi / 2.0) - self.azmuth)
+            path.transformUsingAffineTransform_(transform)
+
+            transform = NSAffineTransform.transform()
+            center = self.graphCenter
+            transform.translateXBy_yBy_(center[0], center[1])
+            transform.scaleBy_(self.graphRadius / self.maxMag)
+            path.transformUsingAffineTransform_(transform)
+
+            path.stroke()
+
+
+#____________________________________________________________
+# Handle GUI values
+
+    def mapVisibleSlider_(self, sender):
+        self.mapVisible = (sender.floatValue())
+        self.setNeedsDisplay_(1)
+
+    def azmuthDisplay_(self, sender):
+        self.setAzmuth(sender.floatValue())
+
+    def azmuthSlider_(self, sender):
+        self.setAzmuth(sender.floatValue())
+
+    def setAzmuth(self, value):
+        self.azmuth = degToRad(value)
+        self.azmuthSlider.setFloatValue_(value)
+        self.azmuthDisplay.setFloatValue_(value)
+        self.setNeedsDisplay_(1)
+
+    def mapScaleDisplay_(self, sender):
+        self.mapScale = sender.floatValue()
+        self.setMapRect()
+
+    def mapScaleSlider_(self, sender):
+        self.mapScale = sender.floatValue()
+        self.setMapRect()
+
+    def mapOffsetNSDisplay_(self, sender):
+        self.mapOffsetNS = sender.floatValue()
+        self.setMapRect()
+
+    def mapOffsetNSSlider_(self, sender):
+        self.mapOffsetNS = sender.floatValue()
+        self.setMapRect()
+
+    def mapOffsetEWDisplay_(self, sender):
+        self.mapOffsetEW = sender.floatValue()
+        self.setMapRect()
+
+    def mapOffsetEWSlider_(self, sender):
+        self.mapOffsetEW = sender.floatValue()
+        self.setMapRect()
+
+    def mouseUp_(self, event):
+        loc = event.locationInWindow()
+        xLoc = loc[x] - self.origin[x]
+        yLoc = loc[y] - self.origin[y]
+        xDelta = self.graphCenter[x] - xLoc
+        yDelta = self.graphCenter[y] - yLoc
+
+
+        scale = 0.5 * self.mapScale * (self.gain / self.totalField) * (self.graphRadius / self.mapBaseRadius)
+        xOffset = xDelta / (scale * self.mapRect[sze][x])
+        yOffset = yDelta / (scale * self.mapRect[sze][y])
+
+        self.mapOffsetEW += xOffset
+        self.mapOffsetNS -= yOffset
+        self.setMapRect()
+
+    def mouseDown_(self, event):
+        self.crossCursor.set()
+
+
+    def setMapRect(self):
+        self.mapScaleDisplay.setFloatValue_(self.mapScale)
+        self.mapScaleSlider.setFloatValue_(self.mapScale)
+        self.mapOffsetEWDisplay.setFloatValue_(self.mapOffsetEW)
+        self.mapOffsetEWSlider.setFloatValue_(self.mapOffsetEW)
+        self.mapOffsetNSDisplay.setFloatValue_(self.mapOffsetNS)
+        self.mapOffsetNSSlider.setFloatValue_(self.mapOffsetNS)
+        self.setNeedsDisplay_(1)
+
+    def mouseEntered_(self, event):
+        print 'CGraphView: mouseEntered_'
+
+    def mouseExited_(self, event):
+        print 'CGraphView: mouseExited_'
Add a comment to this file

pyobjc/Examples/AppKit/FieldGraph/CrossCursor.tiff

Added
New image
Add a comment to this file

pyobjc/Examples/AppKit/FieldGraph/English.lproj/InfoPlist.strings

Binary file added.

pyobjc/Examples/AppKit/FieldGraph/English.lproj/MainMenu.nib/classes.nib

+{
+    IBClasses = (
+        {
+            ACTIONS = {
+                fieldDisplay0 = id; 
+                fieldDisplay1 = id; 
+                fieldDisplay2 = id; 
+                fieldSlider0 = id; 
+                fieldSlider1 = id; 
+                fieldSlider2 = id; 
+                phaseDisplay0 = id; 
+                phaseDisplay1 = id; 
+                phaseDisplay2 = id; 
+                phaseSlider0 = id; 
+                phaseSlider1 = id; 
+                phaseSlider2 = id; 
+                settingDrawerButton = id; 
+                spacingDisplay = id; 
+                spacingSlider = id; 
+            }; 
+            CLASS = CGraphController; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {
+                RMSGainDisplay = NSTextField; 
+                fieldDisplay0 = NSTextField; 
+                fieldDisplay1 = NSTextField; 
+                fieldDisplay2 = NSTextField; 
+                fieldNormalizeCheck = NSButton; 
+                fieldSlider0 = NSSlider; 
+                fieldSlider1 = NSSlider; 
+                fieldSlider2 = NSSlider; 
+                graphModel = CGraphModel; 
+                graphView = CGraphView; 
+                phaseDisplay0 = NSTextField; 
+                phaseDisplay1 = NSTextField; 
+                phaseDisplay2 = NSTextField; 
+                phaseSlider0 = NSSlider; 
+                phaseSlider1 = NSSlider; 
+                phaseSlider2 = NSSlider; 
+                settingDrawer = NSDrawer; 
+                spacingDisplay = NSTextField; 
+                spacingSlider = NSSlider; 
+            }; 
+            SUPERCLASS = NSObject; 
+        }, 
+        {CLASS = CGraphModel; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 
+        {
+            ACTIONS = {
+                azmuthDisplay = id; 
+                azmuthSlider = id; 
+                mapOffsetEWDisplay = id; 
+                mapOffsetEWSlider = id; 
+                mapOffsetNSDisplay = id; 
+                mapOffsetNSSlider = id; 
+                mapScaleDisplay = id; 
+                mapScaleSlider = id; 
+                mapVisibleSlider = id; 
+            }; 
+            CLASS = CGraphView; 
+            LANGUAGE = ObjC; 
+            OUTLETS = {
+                azmuthDisplay = NSTextField; 
+                azmuthSlider = NSSlider; 
+                mapOffsetEWDisplay = NSTextField; 
+                mapOffsetEWSlider = NSSlider; 
+                mapOffsetNSDisplay = NSTextField; 
+                mapOffsetNSSlider = NSSlider; 
+                mapScaleDisplay = NSTextField; 
+                mapScaleSlider = NSSlider; 
+                mapVisibleSlider = NSSlider; 
+            }; 
+            SUPERCLASS = NSView; 
+        }, 
+        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
+    ); 
+    IBVersion = 1; 
+}

pyobjc/Examples/AppKit/FieldGraph/English.lproj/MainMenu.nib/info.nib

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>IBDocumentLocation</key>
+	<string>498 108 462 357 0 0 1440 878 </string>
+	<key>IBEditorPositions</key>
+	<dict>
+		<key>29</key>
+		<string>232 562 318 44 0 0 1440 878 </string>
+		<key>325</key>
+		<string>575 426 290 321 0 0 1440 878 </string>
+	</dict>
+	<key>IBFramework Version</key>
+	<string>313.0</string>
+	<key>IBOpenObjects</key>
+	<array>
+		<integer>325</integer>
+		<integer>21</integer>
+	</array>
+	<key>IBSystem Version</key>
+	<string>6L60</string>
+</dict>
+</plist>
Add a comment to this file

pyobjc/Examples/AppKit/FieldGraph/English.lproj/MainMenu.nib/keyedobjects.nib

Binary file added.

Add a comment to this file

pyobjc/Examples/AppKit/FieldGraph/English.lproj/MainMenu.nib/objects.nib

Binary file added.

pyobjc/Examples/AppKit/FieldGraph/FieldGraph.pbproj/project.pbxproj

+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 39;
+	objects = {
+		080E96DCFE201CFB7F000001 = {
+			fileRef = 29B97318FDCFA39411CA2CEA;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		080E96DDFE201D6D7F000001 = {
+			children = (
+				80B4682A049EAB060000008F,
+				803B3A9D049F59870000008F,
+				8053195804A095AA0039F02A,
+				803B3A9B049F58DF0000008F,
+			);
+			isa = PBXGroup;
+			name = Classes;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		089C165CFE840E0CC02AAC07 = {
+			children = (
+				089C165DFE840E0CC02AAC07,
+			);
+			isa = PBXVariantGroup;
+			name = InfoPlist.strings;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		089C165DFE840E0CC02AAC07 = {
+			fileEncoding = 10;
+			isa = PBXFileReference;
+			lastKnownFileType = text.plist.strings;
+			name = English;
+			path = English.lproj/InfoPlist.strings;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		089C165EFE840E0CC02AAC07 = {
+			fileRef = 089C165CFE840E0CC02AAC07;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+//080
+//081
+//082
+//083
+//084
+//100
+//101
+//102
+//103
+//104
+		1058C7A1FEA54F0111CA2CBB = {
+			fallbackIsa = PBXFileReference;
+			isa = PBXFrameworkReference;
+			lastKnownFileType = wrapper.framework;
+			name = Cocoa.framework;
+			path = /System/Library/Frameworks/Cocoa.framework;
+			refType = 0;
+			sourceTree = "<absolute>";
+		};
+//100
+//101
+//102
+//103
+//104
+//170
+//171
+//172
+//173
+//174
+		17587328FF379C6511CA2CBB = {
+			explicitFileType = wrapper.application;
+			fallbackIsa = PBXFileReference;
+			isa = PBXApplicationReference;
+			path = FieldGraph.app;
+			refType = 3;
+			sourceTree = BUILT_PRODUCTS_DIR;
+		};
+//170
+//171
+//172
+//173
+//174
+//190
+//191
+//192
+//193
+//194
+		19C28FACFE9D520D11CA2CBB = {
+			children = (
+				17587328FF379C6511CA2CBB,
+			);
+			isa = PBXGroup;
+			name = Products;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+//190
+//191
+//192
+//193
+//194
+//290
+//291
+//292
+//293
+//294
+		29B97313FDCFA39411CA2CEA = {
+			buildSettings = {
+			};
+			buildStyles = (
+				4A9504CCFFE6A4B311CA0CBA,
+				4A9504CDFFE6A4B311CA0CBA,
+			);
+			hasScannedForEncodings = 1;
+			isa = PBXProject;
+			mainGroup = 29B97314FDCFA39411CA2CEA;
+			projectDirPath = "";
+			targets = (
+				29B97326FDCFA39411CA2CEA,
+			);
+		};
+		29B97314FDCFA39411CA2CEA = {
+			children = (
+				080E96DDFE201D6D7F000001,
+				29B97315FDCFA39411CA2CEA,
+				29B97317FDCFA39411CA2CEA,
+				29B97323FDCFA39411CA2CEA,
+				19C28FACFE9D520D11CA2CBB,
+			);
+			isa = PBXGroup;
+			name = CurrencyConverter;
+			path = "";
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		29B97315FDCFA39411CA2CEA = {
+			children = (
+				803B3A9F049F59ED0000008F,
+				29B97316FDCFA39411CA2CEA,
+			);
+			isa = PBXGroup;
+			name = "Other Sources";
+			path = "";
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		29B97316FDCFA39411CA2CEA = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.c.objc;
+			path = "bin-python-main.m";
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		29B97317FDCFA39411CA2CEA = {
+			children = (
+				B7BC45D1061E4C5900A96856,
+				B7BC45D2061E4C5900A96856,
+				29B97318FDCFA39411CA2CEA,
+				089C165CFE840E0CC02AAC07,
+			);
+			isa = PBXGroup;
+			name = Resources;
+			path = "";
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		29B97318FDCFA39411CA2CEA = {
+			children = (
+				29B97319FDCFA39411CA2CEA,
+			);
+			isa = PBXVariantGroup;
+			name = MainMenu.nib;
+			path = "";
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		29B97319FDCFA39411CA2CEA = {
+			isa = PBXFileReference;
+			lastKnownFileType = wrapper.nib;
+			name = English;
+			path = English.lproj/MainMenu.nib;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		29B97323FDCFA39411CA2CEA = {
+			children = (
+				77AD46F403ECA7E2004B557F,
+				29B97324FDCFA39411CA2CEA,
+				1058C7A1FEA54F0111CA2CBB,
+				29B97325FDCFA39411CA2CEA,
+			);
+			isa = PBXGroup;
+			name = "Frameworks & Modules";
+			path = "";
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		29B97324FDCFA39411CA2CEA = {
+			fallbackIsa = PBXFileReference;
+			isa = PBXFrameworkReference;
+			lastKnownFileType = wrapper.framework;
+			name = AppKit.framework;
+			path = /System/Library/Frameworks/AppKit.framework;
+			refType = 0;
+			sourceTree = "<absolute>";
+		};
+		29B97325FDCFA39411CA2CEA = {
+			fallbackIsa = PBXFileReference;
+			isa = PBXFrameworkReference;
+			lastKnownFileType = wrapper.framework;
+			name = Foundation.framework;
+			path = /System/Library/Frameworks/Foundation.framework;
+			refType = 0;
+			sourceTree = "<absolute>";
+		};
+		29B97326FDCFA39411CA2CEA = {
+			buildPhases = (
+				29B97327FDCFA39411CA2CEA,
+				29B97328FDCFA39411CA2CEA,
+				29B9732BFDCFA39411CA2CEA,
+				29B9732DFDCFA39411CA2CEA,
+				F60DD8ED0358A61B01C8ED3C,
+			);
+			buildSettings = {
+				FRAMEWORK_SEARCH_PATHS = "";
+				HEADER_SEARCH_PATHS = "";
+				INSTALL_PATH = "$(HOME)/Applications";
+				LIBRARY_SEARCH_PATHS = "";
+				OTHER_CFLAGS = "";
+				OTHER_LDFLAGS = "";
+				PRODUCT_NAME = FieldGraph;
+				SECTORDER_FLAGS = "";
+				WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+				WRAPPER_EXTENSION = app;
+			};
+			dependencies = (
+			);
+			isa = PBXApplicationTarget;
+			name = FieldGraph;
+			productInstallPath = "$(HOME)/Applications";
+			productName = CurrencyConverter;
+			productReference = 17587328FF379C6511CA2CBB;
+			productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>FieldGraph</string>
+	<key>CFBundleIconFile</key>
+	<string></string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>0.1</string>
+	<key>NSMainNibFile</key>
+	<string>MainMenu</string>
+	<key>NSPrincipalClass</key>
+	<string>NSApplication</string>
+</dict>
+</plist>
+";
+		};
+		29B97327FDCFA39411CA2CEA = {
+			buildActionMask = 2147483647;
+			files = (
+			);
+			isa = PBXHeadersBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		29B97328FDCFA39411CA2CEA = {
+			buildActionMask = 2147483647;
+			files = (
+				080E96DCFE201CFB7F000001,
+				089C165EFE840E0CC02AAC07,
+				80B4682B049EAB060000008F,
+				803B3A9C049F58DF0000008F,
+				803B3AA0049F59ED0000008F,
+				803B3AA1049F5B620000008F,
+				80A1BFB904A2ACF800A8020C,
+				B7BC45D3061E4C5900A96856,
+				B7BC45D4061E4C5900A96856,
+			);
+			isa = PBXResourcesBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		29B9732BFDCFA39411CA2CEA = {
+			buildActionMask = 2147483647;
+			files = (
+				29B9732CFDCFA39411CA2CEA,
+			);
+			isa = PBXSourcesBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		29B9732CFDCFA39411CA2CEA = {
+			fileRef = 29B97316FDCFA39411CA2CEA;
+			isa = PBXBuildFile;
+			settings = {
+				ATTRIBUTES = (
+				);
+			};
+		};
+		29B9732DFDCFA39411CA2CEA = {
+			buildActionMask = 2147483647;
+			files = (
+				F60DD8CF0358A5C101C8ED3C,
+			);
+			isa = PBXFrameworksBuildPhase;
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+//290
+//291
+//292
+//293
+//294
+//4A0
+//4A1
+//4A2
+//4A3
+//4A4
+		4A9504CCFFE6A4B311CA0CBA = {
+			buildRules = (
+			);
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				OPTIMIZATION_CFLAGS = "-O0";
+				ZERO_LINK = YES;
+			};
+			isa = PBXBuildStyle;
+			name = Development;
+		};
+		4A9504CDFFE6A4B311CA0CBA = {
+			buildRules = (
+			);
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				ZERO_LINK = NO;
+			};
+			isa = PBXBuildStyle;
+			name = Deployment;
+		};
+//4A0
+//4A1
+//4A2
+//4A3
+//4A4
+//770
+//771
+//772
+//773
+//774
+		77AD46F403ECA7E2004B557F = {
+			fallbackIsa = PBXFileReference;
+			includeInIndex = 1;
+			isa = PBXFolderReference;
+			lastKnownFileType = file;
+			name = PyObjC;
+			path = "/usr/lib/python2.2/site-packages/PyObjC";
+			refType = 0;
+			sourceTree = "<absolute>";
+		};
+		77AD475703ECA800004B557F = {
+			fileRef = 77AD46F403ECA7E2004B557F;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+//770
+//771
+//772
+//773
+//774
+//800
+//801
+//802
+//803
+//804
+		803B3A9B049F58DF0000008F = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = text.script.python;
+			path = CGraphView.py;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		803B3A9C049F58DF0000008F = {
+			fileRef = 803B3A9B049F58DF0000008F;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		803B3A9D049F59870000008F = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = text.script.python;
+			path = CGraphController.py;
+			refType = 4;
+			sourceTree = "<group>";
+		};