[Pythonmac-SIG] Re: [Pyobjc-dev] @selector(mymethod:) with pyobjc?

Just van Rossum just at letterror.com
Thu Jan 20 16:43:15 CET 2005


whamoo wrote:

> I'm writing an application with dinamic menu (NSMenu - NSMenuItem),
> but i've some problem with this function:
> [[NSMenuItem alloc] initWithTitle:action:keyEquivalent:]
> 
> I want to pass to "action:" a function of my class, in objc i must use 
> this code @selector(mioMetodo:)
> In Python how to translate this?
> 
> menuitem = 
> NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(str(a), "Here 
> the code" , "")

menuitem = NSMenuItem.alloc().initWithTitle_action_keyEquivalent_(
           str(a), "mioMetodo:" , "")

Just


More information about the Pythonmac-SIG mailing list