[Pythonmac-SIG] Is the menu enabled?

Jack Jansen jack@oratrix.nl
Wed, 24 Nov 1999 17:29:58 +0100


> >Now, foo is a resource object (resources and handles are the same
> >thing in MacPython, for some odd reason).  You can get its data (it's
> >just a member, IIRC).  That data is of the same format as documented
> >in your favorite toolbox reference (i.e., whatever a MenuHandle
> >refers to).  You can use the struct module to unpack this and get
> >whatever you need out of it.
> 
> That sounds like an impending "Carbon" problem (or an already-solved Carbon
> problem, perhaps, if the Python object's accessors have been taught about
> Carbon).

John,
as you seem to know more about Carbon than I do (I know little more than what 
I learned by running the carbon dating app on Python:-), maybe you can tell me 
whether the code needs fixing. Currently if X is a handle and you access 
X.data from Python what the C code does is lock the handle, create a new 
Python string object of the right size, copy the data and unlock the handle. 
Assigning to X.data does the same in reverse, with SetHandleSize() called to 
give the handle the right size.

Is this something that will survive the Carbon transition? If not, where do I 
find out what I should do?
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm