Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2005
    Posts
    5
    Rep Power
    0

    Question Replace default Python icon


    Hi there,

    1. I am trying to get rid of default python icon from my MainApplication.py. Is there any way I can replace default python.ico with my XYZ.ico?

    2. Also I am trying to get rid of default TKinter icon (“Red color Tk”) that appears on the top left side of main window.

    I’d appreciate anybody’s help.

    Thanks in advance,

    -CoolB
  2. #2
  3. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    The Python path has a file called python.ico, correct? Name your icon, XYZ.ico with the name python.ico instead. And replace the files in the Python path.
  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
    ya but that would mess every other program up as well
    Those people who think they know everything are a great annoyance to those of us who do.
  6. #4
  7. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    That's the only way you can change it as far as I know.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2005
    Posts
    5
    Rep Power
    0
    If I change the default py.ico with my XYZ.ico it replaces the icon globally. I just want to change the icons of my application.
  10. #6
  11. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    Originally Posted by †Yegg†
    That's the only way you can change it as far as I know.
    Read.

    Comments on this post

    • EvilGuru disagrees
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2005
    Posts
    5
    Rep Power
    0
    Python Gurus,

    Still waiting for your help...
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2002
    Posts
    89
    Rep Power
    13
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2005
    Posts
    5
    Rep Power
    0
    Thanks Jimmy. This link is quite helpful but I am not able to compile the code because it needs some additional libraries to compile win32con and win32gui.
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2005
    Posts
    145
    Rep Power
    10
    Noes! Noes!
    It is actually very simple to change the icon in a TK app, very simple:
    Code:
    from Tkinter import *
    
    root = Tk()
    lab = Label(root)
    lab.pack(expand=YES, fill=BOTH)
    
    # change window icon
    root.wm_iconbitmap(r'C:\Python24\py.ico')           # <---
    root.wm_title('Viewer')
    mainloop()
    There you go, I got that off of Mark Lutz's site (the author of Programming Python).
  20. #11
  21. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    Originally Posted by EvilGuru
    Noes! Noes!
    It is actually very simple to change the icon in a TK app, very simple:
    Code:
    from Tkinter import *
    
    root = Tk()
    lab = Label(root)
    lab.pack(expand=YES, fill=BOTH)
    
    # change window icon
    root.wm_iconbitmap(r'C:\Python24\py.ico')           # <---
    root.wm_title('Viewer')
    mainloop()
    There you go, I got that off of Mark Lutz's site (the author of Programming Python).

    I was referring to his first question. Not the one involving Tkinter.
  22. #12
  23. 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
    well I understood the first question as an app in a Directory how do you change it there.

    not only in the tkinter window
    Those people who think they know everything are a great annoyance to those of us who do.
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    394
    Rep Power
    52
    Hi!

    EvilGuru, wm_iconbitmap sets the bitmap for the iconified widget. I don't think this is what CoolB wanted.

    Regards, mawe
  26. #14
  27. 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
    but thats the Tk window picture
    Last edited by monkeyman23555; June 25th, 2005 at 04:33 PM.
    Those people who think they know everything are a great annoyance to those of us who do.
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2005
    Posts
    145
    Rep Power
    10
    His second question was changing the icon of the program while it is running (taskbar and titlebar) which the quick snipped of code I posted does. As for the first question, I am not sure if it can be done at all.
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo