View Single Post
Old Mar 9th, 2008, 5:46 PM   #6
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4 OpenLoop is on a distinguished road
Re: Set application Icon wxPython

I tried that and it seems to work... I was calling self.SetIcon(self, favicon) and it complained about the arguments but my real issue was reading the icon from a file.

I really don't understand the 'self' keyword. I try to think of it as 'this' in C++, but why does every function of a class has to have it as first argument in the definition, but then when you call it you have to omit the first argument? It's just a confusing way to do things!

Back to the icon issue, this is unrelated but if anyone out there is looking for a way to set the icon of an exe file when using py2exe, here's how your setup.py should look like:
PYTHON Syntax (Toggle Plain Text)
  1. from distutils.core import setup
  2. import py2exe
  3.  
  4. setup(
  5. windows = [
  6. {
  7. "script": "Datetool.pyw",
  8. "icon_resources": [(1, "icon.ico")]
  9. }
  10. ],
  11. )
OpenLoop is offline   Reply With Quote