Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

meaning of the parameters of the root.tk.call() method

Could someone explain to me the meaning of the parameters of this root.tk.call() method?

this method is for to define the tkinter application icon. As I recently changed from windows to linux I’m having this difficulty , because in windows it was a very simple method.

code:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

import tkinter as tk

root=tk.Tk()

root.geometry("600x400+400+200")

root.title('MInha aplicação GUI')

**root.tk.call('wm', 'iconphoto', root._w, tk.PhotoImage(file='images_gallery_21525.png'))**

root.mainloop()

>Solution :

The canonical documentation can be found in the man page of the wm iconphoto command.

  • wm is the name of the command being run.
  • iconphoto is the name of the subcommand of the wm command.
  • root._w, is the internal name for the widget that should use the image.
  • tk.PhotoImage(...) creates a PhotoImage which will appear on the window.
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading