[Pyobjc-dev] Pyobjc and global hot key, help please
Brought to you by:
ronaldoussoren
From: whamoo <wh...@rk...> - 2005-06-17 11:58:45
|
Hi to all, i've find an example in pyobjc documentation that use a global hot key (HotKeyPython), and i need to use this in one of my application, but i can't understand why in my app doesn't work. I've started by a xcode project (pyobjc application), and i have added to my main class this: (simple cut and paste from example, changing the name of the class) def finishLaunching(self): super(delibarAppDelegate, self).finishLaunching() self.hotKeyRef = RegisterEventHotKey(38, cmdKey | controlKey, (0, 0), GetApplicationEventTarget(), 0) NSLog("vado") def sendEvent_(self, theEvent): NSLog("qui va") if theEvent.type() == NSSystemDefined and \ theEvent.subtype() == kEventHotKeyPressedSubtype: self.app.activateIgnoringOtherApps_(True) NSRunAlertPanel(u'Hot Key Pressed', u'Hot Key Pressed', None, None, None) super(delibarAppDelegate, self).sendEvent_(theEvent) But all the time i get this error: Exception raised during posting of notification. Ignored. exception: exceptions.AttributeError: 'super' object has no attribute 'finishLaunching' I need to put other things? The method finishLaunching is in the delibarappDelegate, why it can't be found? Thanks a lot for help ;-) Matteo Rattotti www.rknet.it Powered by: - MacOsX - Gnu / Linux Debian Sarge - Amiga Os 3.9 - Milk |