[Pythonmac-SIG] A question about embedding with Mac OS X Carbon

Jay Koutavas jay@heynow.com
Sat, 13 Jul 2002 14:23:45 -0400


[Although this email is slightly off-topic (it goes into some 
specifics about building MacCVS), I think it's worth adding to the 
public thread I've started on this subject.

Note, the troubles I'm seeing with building MacCVS are *not* 
indicative of the quality of MacCVS. I've used MacCVS before and can 
say it's a very worthy CVS client. More accurately, they're 
indicative of missing information I have as I come up to speed on the 
subject of building MacCVS and Python.

With that all said, here's my next email on this subject, which 
contains additional information on what I'm trying to achieve with my 
Python embed.

/Jay]

Alex,

Thank you for your emails on this subject.

One thing I realized, after reading the thread was that I didn't 
clarify the target of my OS X Carbon application. It's CFM, not 
Mach-O. The reason I am CFM-targeted is that my application needs to 
also run on Mac OS 9. Single binary. It is not a requirement that the 
application supports Python when running on OS 9, thus the weak link 
I spoke of in my opening email. Also, for sake of providing possible 
missing useful information, I'm using CodeWarrior 7.2 as my 
development environment. My C/C++ application also runs on Windows, 
and am using CodeWarrior there too.

I learned from this thread that if I'm going to embed Carbon Python 
into a CFM application running on Mac OS X, I'll either have to use 
GUSI, or I'll have to do the rather tedious Mach-O --> CFM wrapping 
technic you outlined in this email. I've done this sort of wrapping 
for specific Quartz calls, so I am familiar with it.

So, I looked over MacCVS. First, I build MacCVS 3.2 Carbon from 
sources and built Python 2.2.1's PythonCarbonLib and dropped it into 
the same folder as the MacCVS application. Launching MacCVS on Mac OS 
X 10.1.5, I found the following two problems:

1) the console window that you provide comes up under macCVS's 
toolbar. I see no way to get it moved into the foreground

2) MacCVS is suffering from the "dual menubar problem" -- where SIOUX 
(via PythonCarbonLib) is presenting it's own rendition of the main 
menu to the right of MacCVS's, resulting in an unusable application.

At this point I thought I'd better get the latest sources, and did a 
full CVS get of MacCVS. I built the Carbon target of MacCVS with 
minimum fuss (there's a broken copy of getdate.c in CVS at the 
moment) and dropped my same copy of PythonCarbonLib into the 
application's folder. MacCVS from latest sources won't launch. What 
happens is it brings up a dialog stating that no debugger was found 
and that it's not a fatal thing, but then silently the application 
quits.

I then tried to make the Mach-O target of MacCVS from latest sources. 
When launching it, there's a dialog saying "You need to put 
PythonCarbonLib into the application folder to get python support." I 
have one there. The MacCVS Mach-o application doesn't recognize it.

My questions:

1) How do I get MacCVS Mach-o to run with Python via latest sources?

2) (the question I was persuing at the start of this) Should I 
attempt to follow your lead and wrap Python-Mach-O calls for use in 
my CFM application? How much work is it? Will it be a mere matter of 
copy/pasting your work?

Best,

/Jay

-- 
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
   Jay Koutavas                         mailto:jay@heynow.com
   Heynow Software                      http://www.heynow.com
   Windham, New Hampshire, USA
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''