2

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()
Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
  • 1
    Note that you can use the python implementation for the most time. Under the hood tkinter uses these calls to provide a high level interface in python. [`root.wm_iconphoto(reference)`](https://stackoverflow.com/a/63324528/13629335) – Thingamabobs Oct 09 '22 at 15:50

1 Answers1

2

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.
Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685