Home > Blockchain >  meaning of the parameters of the root.tk.call() method
meaning of the parameters of the root.tk.call() method

Time:10-09

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:

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()

CodePudding user response:

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.
  • Related