[Pythonmac-SIG] Is the menu enabled?

John W Baxter jwblist@olympus.net
Sun, 21 Nov 1999 20:52:40 -0800


At 9:51 -0700 10/12/99, Joseph J. Strout wrote:
>Go it a step further.  Start with "inspect(Menu)" rather than
>"dir(Menu)", as you'll have easy access to the docstrings for each
>function this way.  Then do  "foo = GetMenuHandle()" (passing
>whatever it needs passed to get this step to work), and then
>"inspect(foo)", which will show you the methods and members of foo.
>
>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
-- 
John Baxter   jwblist@olympus.net      Port Ludlow, WA, USA