Commits

Ronald Oussoren committed fc3eeff

- Enable package-building in Scripts/make_distrib.py
- Regenerate documentation
- Minor updates to tutorial_reading.txt: It was not valid ReST
- Layout changes to tutorial_embed.txt, add a comment. I've verified that
you'll end up with a working proram when following steps the tutorial.

Comments (0)

Files changed (8)

pyobjc/Doc/api-notes-macosx.html

                 """ Actual implementation goes here """
                 pass
 
-        mysheetDidEnd = AppKit.endSheetMethod(mysheetDidEnd)
+        mysheetDidEnd = PyObjCTools.AppHelper.endSheetMethod(
+                mysheetDidEnd)
 </pre>
 <h3><a href="#id7" name="class-nsapplication">Class NSApplication</a></h3>
 <p><code><span>NSModalSession</span></code> objects are wrapped as opaque values. You can check if

pyobjc/Doc/coding-style.html

 <li>Add appropriate ReST style fields to the top of the document as comments:<pre>
 # Author: David Goodger
 # Contact: goodger@users.sourceforge.net
-# Revision: $Revision: 1.11 $
-# Date: $Date: 2003/06/28 12:57:50 $
+# Revision: $Revision: 1.12 $
+# Date: $Date: 2003/06/29 16:32:26 $
 # Copyright: This module has been placed in the public domain.
 </pre>
 </li>

pyobjc/Doc/tutorial_embed/extending_objc_with_python.html

 % cp -R src/PythonGlue.* SimpleComboBoxPlus
 </pre>
 </li>
-<li>Add <code><span>PythonGlue.h</span></code> and <code><span>PythonGlue.m</span></code> to the &quot;Classes&quot; group.<blockquote>
-<p>These files contain a class <code><span>PythonGlue</span></code> that does nothing
+<li>Add <code><span>PythonGlue.h</span></code> and <code><span>PythonGlue.m</span></code> to the &quot;Classes&quot; group.<p>These files contain a class <code><span>PythonGlue</span></code> that does nothing
 visibly useful, but it has interesting side effects: when the first
 class instance is initialized it will initialize the Python interpreter,
 add the Resource folder of your application to the Python search path
 and import any modules from that Resources folder. The first bit of
 this is done by the ObjC code, the latter two by the Python code
 in <code><span>PythonGlue.py</span></code>.</p>
-</blockquote>
 </li>
 <li>Add <code><span>PythonGlue.py</span></code> to the &quot;Resources&quot; group.</li>
 <li>Select the &quot;Frameworks&quot; group, &quot;Add Framework...&quot;, 
 <li>Now we need to arrange to have a <code><span>PythonGlue</span></code> object be instantiated
 being called early during startup. A good place to do this for the
 current application is when <code><span>MainMenu.nib</span></code> is loaded, as it does not
-contain any Python dependencies itself. Subclass <code><span>NSObject</span></code> and call
-the new class PythonGlue. Instantiate it. Use this instance as the
-application delegate for the File Owner.<blockquote>
-<p>I think this method will not work if you want to use Python-based
+contain any Python dependencies itself.<p>Open the MainMenu.nib in Interface Builder and define a subclas of 
+<code><span>NSObject</span></code> and call the new class PythonGlue. Instantiate it. Use this 
+instance as the application delegate for the File Owner.</p>
+<blockquote>
+<p>Jack: I think this method will not work if you want to use Python-based
 classes in your main NIB file. Suggestions for how to make sure
 a PythonGlue object is instantiated before our main NIB file is read are
 hereby requested.</p>
+<p>Ronald: You might add <code><span>[[PythonGlue</span> <span>alloc]</span> <span>init]</span></code> to <code><span>main.m</span></code>, 
+before the call to <code><span>NSApplicationMain</span></code>. You'd also have to create an 
+autorelease pool before creating the <code><span>PythonGlue</span></code> instance.</p>
 </blockquote>
 </li>
 <li>Now compile, build and run. You will get a message printed to

pyobjc/Doc/tutorial_embed/extending_objc_with_python.txt

    into the ``SimpleComboBoxPlus`` folder::
 
 	% cp -R src/PythonGlue.* SimpleComboBoxPlus
-   
+
 4. Add ``PythonGlue.h`` and ``PythonGlue.m`` to the "Classes" group.
 
-	These files contain a class ``PythonGlue`` that does nothing
-	visibly useful, but it has interesting side effects: when the first
-	class instance is initialized it will initialize the Python interpreter,
-	add the Resource folder of your application to the Python search path
-	and import any modules from that Resources folder. The first bit of
-	this is done by the ObjC code, the latter two by the Python code
-	in ``PythonGlue.py``.
+   These files contain a class ``PythonGlue`` that does nothing
+   visibly useful, but it has interesting side effects: when the first
+   class instance is initialized it will initialize the Python interpreter,
+   add the Resource folder of your application to the Python search path
+   and import any modules from that Resources folder. The first bit of
+   this is done by the ObjC code, the latter two by the Python code
+   in ``PythonGlue.py``.
 
 5. Add ``PythonGlue.py`` to the "Resources" group.
 
 7. Now we need to arrange to have a ``PythonGlue`` object be instantiated
    being called early during startup. A good place to do this for the
    current application is when ``MainMenu.nib`` is loaded, as it does not
-   contain any Python dependencies itself. Subclass ``NSObject`` and call
-   the new class PythonGlue. Instantiate it. Use this instance as the
-   application delegate for the File Owner.
+   contain any Python dependencies itself. 
    
-	I think this method will not work if you want to use Python-based
+   Open the MainMenu.nib in Interface Builder and define a subclas of 
+   ``NSObject`` and call the new class PythonGlue. Instantiate it. Use this 
+   instance as the application delegate for the File Owner.
+   
+	Jack: I think this method will not work if you want to use Python-based
 	classes in your main NIB file. Suggestions for how to make sure
 	a PythonGlue object is instantiated before our main NIB file is read are
 	hereby requested.
+
+	Ronald: You might add ``[[PythonGlue alloc] init]`` to ``main.m``, 
+	before the call to ``NSApplicationMain``. You'd also have to create an 
+	autorelease pool before creating the ``PythonGlue`` instance.
+
    
 8. Now compile, build and run. You will get a message printed to
    standard output ("PythonGlue: Warning: no Python modules found")
     you would probably put up a dialog in this case. Actually, in a real application
     you would disable the "Ask iTunes" button unless iTunes was active. All that
     is left as an exercise to the reader.
-   
+   

pyobjc/Doc/tutorial_reading.txt

+======================================
 Understanding existing PyObjC examples
 ======================================
 
 Cocoa is inherently different from common toolkits such as Tk, wxWindows,
 Carbon, win32 and all the other popular ones. Apple's documentation explains this,
 but in the introductory sections that are often quickly glanced over. It is a
-good idea to refer back to XXXX after reading this section. If you really
+good idea to refer back to `Application Architecture`__ after reading this section. If you really
 want you can break out of the architecture sketched in this section, but
 then you are on your own, really: Cocoa and Interface Builder really
 expect you to follow this model.
 
+.. __: http://developer.apple.com/documentation/Cocoa/Conceptual/AppArchitecture/index.html
+
 Cocoa is built on the Model-View-Controller paradigm (MVC). What this means
 is that the application code is going to be split into three parts:
 
   number (an amount of money in currency A) by another (the conversion
   rate from currency A to currency B), as in the currency converter
   application you built in the first tutorial.
+
 - The *View* is what the user sees on-screen, plus his or her interaction
   with it.
+
 - The *Controller* is the glue that binds these two together. In the
   currency converter example, it is the code that gets called when the user
   presses the "Convert" button, whereupon it gets the data from the "amount"
 
 	The section above explains a lot of the strangeness in PyObjC
 	programs: why you don't create windows and other dialogs (they
-	already exist); why you shouldn't do initialization in `__init__`
+	already exist); why you shouldn't do initialization in ``__init__``
 	(because it will be called at some undefined point in time, while
-	reading the NIB) but in `AwakeFromNIB` in stead; why you don't
+	reading the NIB) but in ``awakeFromNIB`` in stead; why you don't
 	have to create and initialize the attributes that tie your
 	objects together (they are already tied together).
 	
 functionality: creating the View and Controller objects and tieing the
 lot together.
 
-XXXX Explain about delegates in stead of subclassing.
+XXXX Explain about delegates instead of subclassing.
 
 Examining a NIB file
 --------------------
 been created for you by Apple. The other four are created by you. Actually:
 "Main Menu" was created by Apple as a convenience, but you are free to modify
 it. The "File's Owner" is either the Controller or the combined Model-Controller
-object, in this case it is the application itself, an instance of `NSApplication`.
+object, in this case it is the application itself, an instance of ``NSApplication``.
 Because this application is not a document-based application the MVC trio
-for the actual conversion window are in here too: `Converter`, `Window` and
-`ConverterController` respectively.
+for the actual conversion window are in here too: ``Converter``, ``Window`` and
+``ConverterController`` respectively.
 
 XXXX Examine ConverterController, show how to see class and methods
 

pyobjc/Examples/00ReadMe.html

 </li>
 <li>TableModel<p>Basic demo that shows how to use a NSTableView.</p>
 </li>
+<li>TinyTinyEdit<p>A minimal Document-based text editor application.</p>
+</li>
 <li>Todo<p>A more complex NIB based applications. This is a document-based application.
 The code is a translation into pyton of an example project in 
 'Learning Cocoa' from O'Reilly</p>

pyobjc/Modules/objc/informal-protocol.m

 	if (selToProtocolMapping == NULL) return NULL;
 	PyObject* item;
 
-	item = PyDict_GetItemString(selToProtocolMapping, SELNAME(selector));
+	item = PyDict_GetItemString(selToProtocolMapping, (char*)SELNAME(selector));
 	if (item != NULL) {
 		return item;
 	}

pyobjc/Scripts/make_distrib.py

 import buildpkg
 import shutil
 
+DOC_ONLY=0
+
 USAGE='Usage: %s [-p python | --with-python=%s] [-h|--help] [-o release-dir|--output-directory=release-dir]\n'%(
 	sys.argv[0], sys.executable)
 
 os.path.walk('Doc', rest2HTML, ['Doc/announcement.txt'])
 rest2HTML(None, '.', ['Install.txt', 'ReadMe.txt', 'Examples/00ReadMe.txt'])
 
-sys.exit(0)
+if DOC_ONLY:
+    sys.exit(0)
 
 print "Running: '%s' setup.py sdist -d '%s'"%(
 			escquotes(PYTHON), escquotes(OUTPUTDIR))