windows icon?

Hello, I am using py2exe to make an executable, it works
just great. Now I would like a custom icon rather than the windows
default. How does one create and
implement an icon? Thanks.

Jeff

I believe the below should work. Substitute 'icon.ico' with the
appropriate file name. I also seem to remember hearing that it doesn't
matter what the memory address is.

windows = [
          { 'script': "script.py", 'icon_resources': [(0x0004,
'icon.ico')]}],

Greg
Dodgeram01
ghassel1[at]twcny.rr.com

···

On Wed, 2004-08-25 at 11:22, Jeff Peery wrote:

Hello, I am using py2exe to make an executable, it works just great.
Now I would like a custom icon rather than the windows default. How
does one create and implement an icon? Thanks.

Jeff

Greg wrote:

I believe the below should work. Substitute 'icon.ico' with the
appropriate file name. I also seem to remember hearing that it doesn't
matter what the memory address is.

windows = [
          { 'script': "script.py", 'icon_resources': [(0x0004,
'icon.ico')]}],

The hearsay appears to be true. In my setup.py I have "1" instead of 0x0004 and it works just the same.

Great thanks for the help!!

I have a couple of questions. I have an icon I saved as a .bmp, is there
a special format for icons that I am required to use? Secondly I have an
error when I included the code that was recommended to me for my setup
file. here is my code and the error:

#setup.py
from distutils.core import setup
import py2exe

setup(windows = [{'wxAppEXKalc.py', 'icon_resources': [(0x0004,
'horse.bmp')]}], version = '1.0')

···

-----------------------------------------------------------
" File "C:\Python23\lib\distutils\core.py", line 149, in se
    dist.run_commands()
  File "C:\Python23\lib\distutils\dist.py", line 907, in ru
    self.run_command(cmd)
  File "C:\Python23\lib\distutils\dist.py", line 927, in ru
    cmd_obj.run()
  File "C:\Python23\Lib\site-packages\py2exe\build_exe.py",
    self.create_binaries(py_files, extensions, dlls)
  File "C:\Python23\Lib\site-packages\py2exe\build_exe.py",
binaries
    arcname, target.script)
  File "C:\Python23\Lib\site-packages\py2exe\build_exe.py",
xecutable
    add_icon(unicode(exe_path), unicode(ico_filename), ico_
RuntimeError: UpdateResource: The parameter is incorrect."

Any thoughts?

Thanks

Jeff
-----Original Message-----
From: Fred P [mailto:fredp@dial.oleane.com]
Sent: Wednesday, August 25, 2004 10:29 AM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] windows icon?

Greg wrote:

I believe the below should work. Substitute 'icon.ico' with the
appropriate file name. I also seem to remember hearing that it doesn't
matter what the memory address is.

windows = [
          { 'script': "script.py", 'icon_resources': [(0x0004,
'icon.ico')]}],

The hearsay appears to be true. In my setup.py I have "1" instead of
0x0004 and it works just the same.

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

"Jeff Peery" <jeffp@seametrics.com> writes:

Great thanks for the help!!

I have a couple of questions. I have an icon I saved as a .bmp, is there
a special format for icons that I am required to use? Secondly I have an
error when I included the code that was recommended to me for my setup
file. here is my code and the error:

#setup.py
from distutils.core import setup
import py2exe

setup(windows = [{'wxAppEXKalc.py', 'icon_resources': [(0x0004,
'horse.bmp')]}], version = '1.0')

IIRC, the file *must* be in windows ICO format.

Greg wrote:

I believe the below should work. Substitute 'icon.ico' with the
appropriate file name. I also seem to remember hearing that it doesn't
matter what the memory address is.

windows = [
          { 'script': "script.py", 'icon_resources': [(0x0004,
'icon.ico')]}],

The hearsay appears to be true. In my setup.py I have "1" instead of
0x0004 and it works just the same.

The 0x0004 or 1 is used to locate icons in the resources. If you want
to use the win32 LoadIcon() function (I don't know if that's available
in wxPython, FWIW), you need this number.
You can put any number of icons into the resources, windows explorer
displays the first one.

Thomas

Ah ok, it must be that my image is not in ico format. What type of
software will save images in this format?

Thanks.

Jeff

···

-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Thomas Heller
Sent: Thursday, August 26, 2004 9:03 AM
To: wxpython-users@lists.wxwidgets.org
Subject: [wxPython-users] Re: windows icon?

"Jeff Peery" <jeffp@seametrics.com> writes:

Great thanks for the help!!

I have a couple of questions. I have an icon I saved as a .bmp, is

there

a special format for icons that I am required to use? Secondly I have

an

error when I included the code that was recommended to me for my setup
file. here is my code and the error:

#setup.py
from distutils.core import setup
import py2exe

setup(windows = [{'wxAppEXKalc.py', 'icon_resources': [(0x0004,
'horse.bmp')]}], version = '1.0')

IIRC, the file *must* be in windows ICO format.

Greg wrote:

I believe the below should work. Substitute 'icon.ico' with the
appropriate file name. I also seem to remember hearing that it

doesn't

matter what the memory address is.

windows = [
          { 'script': "script.py", 'icon_resources': [(0x0004,
'icon.ico')]}],

The hearsay appears to be true. In my setup.py I have "1" instead of
0x0004 and it works just the same.

The 0x0004 or 1 is used to locate icons in the resources. If you want
to use the win32 LoadIcon() function (I don't know if that's available
in wxPython, FWIW), you need this number.
You can put any number of icons into the resources, windows explorer
displays the first one.

Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

I use Irfanview. Freeware, very easy
and effective. Suck in some image file, then save it as .ico. Couldn’t
be much easier.

http://www.irfanview.com/

···

Gary H. Merrill

Director and Principal Scientist, New Applications

Data Exploration Sciences

GlaxoSmithKline Inc.

(919) 483-8456

I use Irfanview. Freeware, very easy and effective. Suck in
some image file, then save it as .ico. Couldn't be much
easier.

http://www.irfanview.com/

Does it automagically save the image in all the different sizes
and color-depths that you are supposed have in an .ico file? [I
couldn't tell based on the info on the web page.]

To get decent-looking icons you really have to create each size
and color-depth by hand, but it would be nice if there was a
program that made an attempt to do it for you.

···

--
Grant Edwards
grante@visi.com

I use Irfanview. Freeware, very easy and effective. Suck in
some image file, then save it as .ico. Couldn't be much
easier.

http://www.irfanview.com/

It appears that it's only free for use by educational or
charity/humanitarian organizations.

It is not free for business or personal use.

···

--
Grant Edwards
grante@visi.com

Well, looking at this again I’ll have to
be sure about the licensing issues. But it looks like the cost
for even a “commercial user” is only US$ 10.00 for a single license.
Still not much (given that wxDesigner costs ten times a much!).

···

Gary H. Merrill

Director and Principal Scientist, New Applications

Data Exploration Sciences

GlaxoSmithKline Inc.

(919) 483-8456

“Grant Edwards”
grante@visi.com

Sent by: grante@visi.com
26-Aug-2004 13:27

Please respond to wxPython-users@lists.wxwidgets.org

To

wxPython-users@lists.wxwidgets.org
cc

jeffpeery@seametrics.com
Subject

[wxPython-users] Re: windows
icon?

`

I use Irfanview. Freeware, very easy and effective. Suck
in

some image file, then save it as .ico. Couldn’t be much

easier.

http://www.irfanview.com/

It appears that it’s only free for use by educational or

charity/humanitarian organizations.

It is not free for business or personal use.

Grant Edwards

grante@visi.com


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org

For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

`

I use Irfanview. Freeware, very easy and effective. Suck in
some image file, then save it as .ico. Couldn't be much
easier.

http://www.irfanview.com/

Don't use that man, it's addictive... I've tried it once like 3-4 years ago and got hooked instantly. It is the speed if there is such a thing. :slight_smile:

Does it automagically save the image in all the different sizes
and color-depths that you are supposed have in an .ico file? [I
couldn't tell based on the info on the web page.]

Ok... IrfanView is good for general image manipulation BUT not that good for icons. It can save in ico format BUT transparancy.... that's another issue, depth, resolution... maybe not.

To get decent-looking icons you really have to create each size
and color-depth by hand, but it would be nice if there was a
program that made an attempt to do it for you.

If you wanna be serious about icons forget the rest use the "Grand Daddy of All Icon Software".
http://www.microangelo.us/

···

On Thu, 26 Aug 2004 12:24:49 -0500, Grant Edwards <grante@visi.com> wrote:

--
Peter Damoc
Hacker Wannabe

Thomas Heller wrote:

The 0x0004 or 1 is used to locate icons in the resources. If you want
to use the win32 LoadIcon() function (I don't know if that's available
in wxPython, FWIW),

I think you can do it with wx.IconBundle

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!