Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Serhiy Storchaka Newsgroups: comp.lang.python Subject: Re: Adding Icon To Tkinter Window Date: Sat, 5 Mar 2016 21:55:40 +0200 Lines: 21 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de Laf8hjDUTJtOv6cQ00Csmg/GIHWaOXcyyQx+hTnHpt1w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'icon': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'window?': 0.09; '...)': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:Adding': 0.16; 'subject:Tkinter': 0.16; 'subject:Window': 0.16; 'tkversion': 0.16; 'windows:': 0.16; 'wrote:': 0.16; 'thanks.': 0.18; 'examples': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'specify': 0.27; 'correct': 0.28; 'code': 0.30; 'error.': 0.31; 'anybody': 0.32; 'skip:p 30': 0.35; 'but': 0.36; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'received:org': 0.37; 'several': 0.38; 'to:addr:python.org': 0.40; 'charset:windows-1252': 0.62; 'different': 0.63; 'python-list': 0.66; '18:47,': 0.84 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: 193.202.118.160 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:104112 On 05.03.16 18:47, Wildman via Python-list wrote: > Anybody have the correct method of adding an icon to a > window? I have found several code examples on the web > but they all result in an error. Thanks. On Windows: root.wm_iconbitmap(default='myapp.ico') .ico-file can contain several icons of different size. Otherwise if TkVersion >= 8.5: root.wm_iconphoto(True, PhotoImage(file='myapp16.gif'), PhotoImage(file='myapp32.gif'), ...) You can specify several icons of different size. If TkVersion >= 8.5 you can use .png-files.