From 3cc6256e30fff10b96c5fea99834c257d5e97542 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Sun, 30 Jan 2011 13:08:21 +0200 Subject: [PATCH] Ignas made icons work on Windows somehow. --- dodo.py | 9 +++------ setup.py | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/dodo.py b/dodo.py index 1b8e1a1..d45e4c9 100755 --- a/dodo.py +++ b/dodo.py @@ -1,5 +1,6 @@ #!/usr/bin/env python import math +import os.path import random import logging import itertools @@ -798,12 +799,8 @@ def main(): window.set_minimum_size(320, 200) # does not work on linux with compiz window.maximize() window.set_mouse_visible(True) - try: - # Breaks on Windows - window.set_icon(load_image('Dodo.png')) - except: - pass - + window.set_icon(pyglet.image.load(os.path.join(pyglet.resource.location('Dodo.png').path, + 'Dodo.png'))) app = Main() app.run() diff --git a/setup.py b/setup.py index 1fe5b6c..3401629 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ 'url': '', 'py2exe.target': '', -# 'py2exe.icon': 'icon.ico', #64x64 + 'py2exe.icon': 'assets\\Dodo.ico', #64x64 'py2exe.binary': APP_NAME, #leave off the .exe, it will be added } @@ -95,7 +95,7 @@ def add_files(dest, generator): }}, windows=[{ 'script': dest, - #'icon_resources': [(1, cfg['py2exe.icon'])], + 'icon_resources': [(0, 'assets\\Dodo.ico')], }], )