[Pythonmac-SIG] objc methods to pythonese

Scott Frankel leknarf at pacbell.net
Thu Mar 23 21:46:54 CET 2006


Thanks for the clarifications!
Scott



On Mar 23, 2006, at 12:06 PM, Jordan Krushen wrote:


> obj-c:
>     [rectangle setWidth:width height:height]
>
> python:
>     rectangle.setWidth_height_(width, height)


On Mar 23, 2006, at 12:11 PM, Zachery Bir wrote:

> You're not assigning the result of that method to 'rectangle'. You  
> want:
>
>   rectangle.setWidth_height_(width, height)
>
> each ':' gets replaced in the python signature with an underscore,  
> and 'rectangle' is the object you're calling setWidth:height: on.
>>
>>
>>      - (id)tableView:(NSTableView *)tableView
>>      objectValueForTableColumn(NSTableColumn *)tableColumn
>>              row:(int)row
>
> That is a method declaration, not a function - don't forget 'self':
>
>   def tableView_objectValueForTableColumn_row_(self, tableView,  
> tableColumn, row):
>
> Zac
>



More information about the Pythonmac-SIG mailing list