Carbon Event Manager (Carbon.CarbonEvt module) - working?

2012-05-15 Thread msmucr
Hello,

i would like to ask you for some information regarding Carbon Event
Manager ( Carbon.CarbonEvt ) library in Python.
I need to recieve and work with few Carbon events in my program. I've
followed some examples on PyObjC site, but wasn't successful. I know,
that both Carbon library and this Python module is deprecated, but
frankly i didn't find any usable alternative except of writing of
something from scratch..
I ended on basic import of required objects from Carbon.CarbonEvt
module -
like "from Carbon.CarbonEvt import RegisterEventHotKey"
I tried it in Python 2.7.1 (standard distribution in OS X 10.7 Lion)
and Python 2.6.1 (standard Apple distribution in OS X 10.6).
Do I have something wrong or is it simply broken and unmaintained now?

Thank You,

Michal
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Carbon Event Manager (Carbon.CarbonEvt module) - working?

2012-05-15 Thread msmucr
On 15 kvě, 21:21, John Gordon  wrote:
> In  msmucr 
>  writes:
>
> > Do I have something wrong or is it simply broken and unmaintained now?
>
> We have no idea if you did anything wrong, because you didn't tell us
> exactly what you did and exactly what error message you received.
>
> --
> John Gordon                   A is for Amy, who fell down the stairs
> [email protected]              B is for Basil, assaulted by bears
>                                 -- Edward Gorey, "The Gashlycrumb Tinies"

Hello,

i'm sorry for my very vague specification. I had problems with
importing of anything from Carbon.CarbonEvt module and i wasn't sure
what is wrong and was little bit stucked.
I tried several desperate things before that as i've never worked with
this module and it is my first thing with Carbon library.. Just before
i read Kevin's reply i've figured, problem was, that OS X shipped
Python wrapper /usr/bin/python runs by default 64bit version on recent
Macs. So bindings for 32bit Carbon lib didn't work.
Here is my output (i've choose RegisterEventHotKey as example):

macmini-E514:~ macek$ /usr/bin/python -c "import sys; print
sys.maxint; from Carbon.CarbonEvt import RegisterEventHotKey;
print(RegisterEventHotKey.__doc__)"
9223372036854775807
Traceback (most recent call last):
  File "", line 1, in 
ImportError: cannot import name RegisterEventHotKey

macmini-E514:~ macek$ env VERSIONER_PYTHON_PREFER_32_BIT=yes /usr/bin/
python -c "import sys; print sys.maxint; from Carbon.CarbonEvt import
RegisterEventHotKey; print(RegisterEventHotKey.__doc__)"
2147483647
(UInt32 inHotKeyCode, UInt32 inHotKeyModifiers, EventHotKeyID
inHotKeyID, EventTargetRef inTarget, OptionBits inOptions) ->
(EventHotKeyRef outRef)

So, now i could start playing with it.. :-)

I'm trying to do something like this in Python
http://www.macosxguru.net/article.php?story=20060204132802111

Best regards and thank you for replies

Michal
-- 
http://mail.python.org/mailman/listinfo/python-list