#1
  1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11

    Taskbar Icon Editing and By time icons


    hi

    I have two related questions so I put them in the same thread does anyone know how to edit the icons on the windows taskbar...

    and by the time icon how can I put an icon there like the other program like antivirus....
    Those people who think they know everything are a great annoyance to those of us who do.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2005
    Posts
    33
    Rep Power
    10
    If you mean the icon at the top left of the window, here is how to do it in wxPython.

    Code:
    icon = wxIcon("youricon.ico", wxBITMAP_TYPE_ICO)
            self.SetIcon(icon)
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11
    no i meant the icon when u minimize it to the icon baar where the clock is located

    Down Right
    Those people who think they know everything are a great annoyance to those of us who do.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Location
    Colorado, USA
    Posts
    68
    Rep Power
    10

    wxPython


    You can build a GUI with wxPython, and I believe there are ways to do it in TK as well.

    example for wxPython:
    Code:
    #setup image object
    icon = wxIcon("favicon.ico", wxBITMAP_TYPE_ICO)
    #setup taskbar icon
    self.tbicon = wx.TaskBarIcon()
    self.tbicon.SetIcon(icon, "Your APP Name")
    #add taskbar icon events
    EVT_TASKBAR_LEFT_DCLICK(self.tbicon,self.OnTaskBarActivate)
    EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarMenu)
    EVT_ICONIZE(self,self.OnMinimize)
    You can to include this as part of your main application class, and if you are familiar with wxPython at all, this will do it.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11
    nope no clue how to use wxpython

    but thanks
    Last edited by monkeyman23555; July 12th, 2005 at 01:19 PM.
    Those people who think they know everything are a great annoyance to those of us who do.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Location
    Colorado, USA
    Posts
    68
    Rep Power
    10
    Here is a pretty simple example using wx and PySimpleApp

    Declare the ico file path when setting up the icon object.

    All it does is add an icon to the taskbar, and grabs a right-click event to exit.
    Needs wxPython installed.

    Code:
    import wx
    
    def OnTaskBarRight(event):
    	app.ExitMainLoop()
    #setup app
    app= wx.PySimpleApp()
    
    #setup icon object
    icon = wx.Icon("favicon.ico", wx.BITMAP_TYPE_ICO)
    
    #setup taskbar icon
    tbicon = wx.TaskBarIcon()
    tbicon.SetIcon(icon, "I am an Icon")
    
    #add taskbar icon event
    wx.EVT_TASKBAR_RIGHT_UP(tbicon, OnTaskBarRight)
    
    app.MainLoop()
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11
    okay well is it possible in TK
    Those people who think they know everything are a great annoyance to those of us who do.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Location
    Colorado, USA
    Posts
    68
    Rep Power
    10
    From what I can find, TK does not allow it on it's own(at least on win32).
    There is apparently a more difficult(than wxPython) method that can be implemented using pywin32.
    Look in the demos that come with pywin32 and find win32gui_taskbar.py.

    Good luck-
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11
    okay thanks
    Those people who think they know everything are a great annoyance to those of us who do.

IMN logo majestic logo threadwatch logo seochat tools logo