[Pythonmac-SIG] Troubles with pygame+py2app to get icon

Pierre-Alain Dorange pdorange at mac.com
Fri Dec 19 07:36:23 CET 2008


Hi,
I got a trouble to have an icon to the Mac bundle of my little game
using py2app.

The bundle is correct but the icon is not set, always got the default
pygame icon.
The icon file is copied and put in the bundle by py2app (in
ressources/english.lproj but the info.plist set CFBundleIconFile to
'PythonApplet.icns'.
The 'PythonApplet.icns' is in the bundle in the main dir.

with the alien example (from py2app) and other pygame examples, the icon
is also not set when bundle.

Any clue, or working samples ?

My config :
        Python 2.5.2
        Pygame 1.8.1rc1
        py2app 0.4.2


the structure on disk :
the icon file (mwar.icns) is located inside 'English.lproj' directory, i
also try to locate it in the main dir but then if icon file is not
copied.

The script : 
#!/usr/bin/env python

from setuptools import setup
from mwarbasic import *

plist = dict(
    CFBundleIconFile='mwar.icns',
    CFBundleName=k_NAME,
    CFBundleShortVersionString=k_VERSION,
    CFBundleGetInfoString=' '.join([k_NAME, k_VERSION]),
    CFBundleExecutable=k_NAME,
    CFBundleIdentifier='org.maddog.microwar',
)

setup(
    data_files=['English.lproj', 'data'],
    setup_requires=["py2app"],
    app=[dict(script="microwar.py", plist=plist,
iconfile='English.lproj/mwar.icns')],
)

-- 
Pierre-Alain Dorange
<http://microwar.sourceforge.net/>



More information about the Pythonmac-SIG mailing list