Adding Icon To Tkinter Window - Followup
Wildman
best_lay at yahoo.com
Sun Mar 6 11:30:09 EST 2016
On Sun, 06 Mar 2016 10:16:55 +0100, Christian Gollwitzer wrote:
> Am 06.03.16 um 06:53 schrieb Wildman:
>> On Sat, 05 Mar 2016 19:36:19 +0100, Christian Gollwitzer wrote:
>>> import Tkinter
>>> from Tkinter import Tk
>>> root = Tk()
>>> img = Tkinter.Image("photo", file="appicon.gif")
>>> root.call('wm','iconphoto',root._w,img)
>>
>> The above worked perfectly. Thank you very much.
>
> Then you should try if it works also with the last line replaced as
>
> root.wm_iconphoto(True, img)
That does not work...
$ ./makexface.py
Traceback (most recent call last):
File "./makexface.py", line 236, in <module>
root.wm_iconphoto(True, img)
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1897, in __getattr__
return getattr(self.tk, attr)
AttributeError: wm_iconphoto
> (as Serhiy and Terry wrote). My system python which I used to test this
> was just too old to wrap iconphoto, yours should be up to date.
>
> Christian
>
>
>> According to "root.eval('info patchlevel')" I have version 8.6.2.
>> PNG worked. That is good because PNG is a common file type for
>> Linux icons.
>
> PS: 8.6.2 is from mid 2014, that's OK - though we've had a brand new
> release (8.6.5) in February 2016
I am using the latest release that is offered in the Debian
repository but I will look into upgrading from other sources.
Thanks for the info.
--
<Wildman> GNU/Linux user #557453
The cow died so I don't need your bull!
More information about the Python-list
mailing list