#NEWLINE# def setIcon( app , icon_data ) : #NEWLINE# #INDENT# data = NSData . dataWithBytes_length_ ( data , len ( icon_data ) ) #NEWLINE# if ( data is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# img = NSImage . alloc ( ) . initWithData_ ( data ) #NEWLINE# if ( img is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# app . setApplicationIconImage_ ( img )