Re: [Pythonmac-SIG] Using AHRegisterHelpBook

2009-05-07 Thread has

Ronald Oussoren wrote:

Another option is PyObjC, it definitly allows you to integrate with  
the native Cocoa help API's.



Out of interest, does PyObjC play nicely with wxPython/Tkinter?

A further option, if it hasn't already been suggested, would be to  
call AHRegisterHelpBook directly via ctypes. Just because Python's Mac  
modules have all been deprecated and removed doesn't mean that all of  
the underlying OS X APIs have done the same. Some have (e.g.  
QuickTime, QuickDraw, and anything GUI-related are best avoided) but  
others are still fully supported.


Or, if futzing with ctypes is too much hassle, consider grabbing the  
source for the Carbon.AH extension and repackage it as part of the  
project. This is what I did with Carbon.AE when developing appscript,  
for example.


HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


[Pythonmac-SIG] Leaning PyObjC

2009-05-07 Thread Kevin Walzer

Hi all,

What's the current best practice for learning PyObjC? I've been 
developing in Python/Tkinter for quite some time, and I've learned 
enough Objective-C/Cocoa to create a small extension that calls into 
some Cocoa methods (it's actually a Tcl extension that I can call, via 
Tkinter, to change my app's dock icon). I'm planning to work through 
some samples in the latest Hillegass book to get familiar with the full 
Cocoa toolchain, i.e. Xcode, IB, etc.)


I'm finding myself a bit lost, however, in how to download, build, and 
play with PyObjC itself. Based on what I've gathered from the PyObjC 
site, I can do the following:


1. Download version 2.0 from SVN or use easy_install 2.2b.
2. Build as outlined in the instructions.
3. Follow the Creating your first PyObjc application tutorial, which 
requires PyObjC 1.3.1.


I'm especially curious about the tutorial--is it up to date? I've read a 
lot about changes between PyObjC 1.x and 2.x, but it's not clear to me 
what those changes are. I do know that the differences between older 
Cocoa tutorials (pre-Leopard) and new tutorials are big enough to make 
it hard to learn from the old ones, owing especially to big changes in 
Interface Builder.


My strong preference is to keep my Python toolchain reasonably close to 
what I'm doing already, i.e. doing my development outside of Xcode and 
using py2app for bundling, rather than using Xcode.


Does this sound like a good approach, or am I missing something 
glaringly obvious? What do others who are shipping PyObjC apps do?


--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Leaning PyObjC

2009-05-07 Thread Bill Janssen
Kevin Walzer k...@codebykevin.com wrote:

 My strong preference is to keep my Python toolchain reasonably close
 to what I'm doing already, i.e. doing my development outside of Xcode
 and using py2app for bundling, rather than using Xcode.

I found crossing this bridge a bit tricky, until I embraced Xcode.
Start a Python-Cocoa project with Xcode.  Look at the framework it
builds for you.  Go on and edit your app delegate, not necessarily using
Xcode.  Hit the Build and Run button in Xcode.  See what happens.
Repeat.

After you've successfully built a couple of Python apps this way, you'll
be better prepared to get into the whole py2app thing.  The major
problem there is that the folks who build and maintain it are
overworked, and have little to no time to update documentation.  So
there are lots of out-of-date documentation pages and examples, which
will mislead you mightily unless you have some other grounding to fall
back on to see if they make sense.

Even then, I have to admit I still don't know how to build a
PreferencePane from scratch.  I've got one working, but I had to take
the example, and hack it into shape.

Oh, and read Will Larson's series:

http://lethain.com/entry/2008/aug/22/an-epic-introduction-to-pyobjc-and-cocoa/

all the way through.

Bill
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig