【问题标题】:Custom taskbar icon in tkinter or customtkintertkinter 或 customtkinter 中的自定义任务栏图标
【发布时间】:2023-02-14 06:18:34
【问题描述】:

我怎样才能得到定制任务栏tkintercustomtkinter 中的图标?

我试过:

# Importing customtkinter as ctk
import customtkinter as ctk

# Creating the root window
root = ctk.CTk()

# Creating the root's title
root.title('test')

# Setting window icon
root.iconbitmap('C\MyDirecory\MyFolder\favicon.ico')

# How can I set the taskbar icon?

我尝试了PyCharm 给我的所有建议,但都没有用。

【问题讨论】:

    标签: python tkinter customtkinter


    【解决方案1】:

    不幸的是,这不是一种选择。 如果你想要一个任务栏图标,你必须将你的 .py 文件导出到一个带有你想要的图标的 .exe 文件。然后它会在您的任务栏上显示正确的图标。

    【讨论】:

    • 谢谢,我使用参数 -i favicon.png 使用 pyintsaller 导出到 .exe
    最近更新 更多