有人可以向我解釋這個 root.tk.call() 方法的引數的含義嗎?
此方法用于定義 tkinter 應用程式圖示。當我最近從 windows 更改為 linux 時,我遇到了這個困難,因為在 windows 中這是一個非常簡單的方法。
代碼:
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()
uj5u.com熱心網友回復:
規范檔案可以在wm iconphoto 命令的手冊頁中找到。
wm是正在運行的命令的名稱。iconphoto是命令的子命令的名稱wm。root._w, 是應該使用影像的小部件的內部名稱。tk.PhotoImage(...)創建一個PhotoImage將出現在視窗上的。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/512043.html
標籤:tkinter
