Modify default icon

Hi all,

Sorry to be a pain, I know this is probably really simple but I can't seem
to find any reference to it.

Can anyone tell me how I change the default icon which appears on the top
right of my applications main window (and represents the app when I
Alt-tab.)

Thanks

Darius

···

--
This communication contains confidential information intended solely for the use of the individual/s and/or entity or entities to whom it was intended to be addressed. If you are not the intended recipient, be aware that any disclosure, copying, distribution, or use of the contents of this transmission is prohibited. If you have received this communication in error, please contact the sender immediately, delete this communication from your system, and do not disclose its contents to any third party, or use its contents. Any opinions expressed are solely those of the author and do not necessarily represent those of Orchestream Ltd or its group of companies unless otherwise specifically stated.

It's a bit more than what you asked for but here's something I ripped
out of one of my programs that does what you want. It also puts the
same icon down in the system tray. (The program it was taken from is
named "Satisfy" because it scores the Stanford Achievement Test, 9th
Edition (SAT9). So it SAT-isfies.)

···

--------------------------------------------------
from wxPython.wx import *
from sys import *

class MyFrame(wxFrame):
  def __init__(self, parent, ID, title):

    ### Edited out the calculations for pos and size ###

    wxFrame.__init__(self, parent, ID, title, pos, size)

    if wxPlatform == "__WXMSW__": # Are we in the Evil Empire?
      self.icon = wxIcon("Data/sat1.ico",wxBITMAP_TYPE_ICO)
      self.tbicon = wxTaskBarIcon()
      self.tbicon.SetIcon(self.icon, "SAT9 Scoring")
      EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarActivate)
      EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarMenu)
      EVT_MENU(self.tbicon, self.TBMENU_RESTORE, self.OnTaskBarActivate)
      EVT_MENU(self.tbicon, self.TBMENU_CLOSE, self.OnTaskBarClose)
    else:
      self.icon = wxIcon("Data/sat1.xpm",wxBITMAP_TYPE_XPM)
    self.SetIcon(self.icon)

    ### The rest of your init code here ... ###

  def OnTaskBarActivate(self, evt):
    if self.IsIconized():
      self.Iconize(false)
    if not self.IsShown():
      self.Show(true)
    self.Raise()

  TBMENU_RESTORE = wxNewId() # Restore application
  TBMENU_CLOSE = wxNewId() # Close application

  def OnTaskBarMenu(self, evt):
    menu = wxMenu()
    menu.Append(self.TBMENU_RESTORE, "Restore Satisfy")
    menu.Append(self.TBMENU_CLOSE, "Close")
    self.tbicon.PopupMenu(menu)
    menu.Destroy()

  def OnTaskBarClose(self, evt):
    if wxPlatform == "__WXMSW__": # Are we in the Evil Empire?
      self.tbicon.RemoveIcon()
    self.Close()
    wxGetApp().ProcessIdle()
--------------------------------------------------------

On Fri, Nov 15, 2002 at 05:11:55PM -0000, Poli, Darius wrote:

Hi all,

Sorry to be a pain, I know this is probably really simple but I can't seem
to find any reference to it.

Can anyone tell me how I change the default icon which appears on the top
right of my applications main window (and represents the app when I
Alt-tab.)

Thanks

Darius

--
This communication contains confidential information intended solely for the use of the individual/s and/or entity or entities to whom it was intended to be addressed. If you are not the intended recipient, be aware that any disclosure, copying, distribution, or use of the contents of this transmission is prohibited. If you have received this communication in error, please contact the sender immediately, delete this communication from your system, and do not disclose its contents to any third party, or use its contents. Any opinions expressed are solely those of the author and do not necessarily represent those of Orchestream Ltd or its group of companies unless otherwise specifically stated.

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

--
--
Kevin Cole, RHCE, Linux Admin | Key ID: 0xE6F332C7
Gallaudet Research Institute | WWW: http://gri.gallaudet.edu/~kjcole/
Hall Memorial Bldg S-419 | Voice: (202) 651-5135
Washington, D.C. 20002-3695 | FAX: (202) 651-5746