Re: [Pyobjc-dev] How to translate from Obj-C?
Brought to you by:
ronaldoussoren
From: Orestis M. <or...@or...> - 2008-09-18 13:45:29
|
#needed imports @IBaction def showOrHideToolPalette_(self, sender): SKTToolPaletteController .sharedToolPaletteController().showOrHideWindow() Don't forget that in python, every class method must have "self" as the first argument. Next time, please post your source code for whatever you've done, so we can look at that rather than trying to guess. Hope that helped, Orestis -- or...@or... http://orestis.gr/ On 18 Sep 2008, at 19:34, Łukasz Dziedzic wrote: > Hi Everybody! > > I'm trying to do my own toolbox in IB. I'm watching carefully Obj-C > example Sketch, and I found in app delegate: > >> - (IBAction)showOrHideToolPalette:(id)sender { >> >> // We always show the same tool palette panel. Its controller >> doesn't get deallocated when the user closes it. >> [[SKTToolPaletteController sharedToolPaletteController] >> showOrHideWindow]; >> >> } >> > > and in SKTToolPaletteController > >> + (id)sharedToolPaletteController { >> static SKTToolPaletteController *sharedToolPaletteController = >> nil; >> >> if (!sharedToolPaletteController) { >> sharedToolPaletteController = [[SKTToolPaletteController >> allocWithZone:NULL] init]; >> } >> >> return sharedToolPaletteController; >> } > > > All my attempts generates error "<class 'objc.error'>: need self > argument" :-( > > Could somebody help me? > > Ł > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |