Tkinker用其他东西替换底部任务栏图标

时间:2017-11-16 11:48:12

标签: python python-3.x tkinter

我想替换屏幕底部的图标。 示例:enter image description here 我知道如何删除工具栏中的图标,这位于屏幕底部。

import ctypes 


def Mbox(title, text, style):
    root = root.iconbitmap(default='app.ico')

    return ctypes.windll.user32.MessageBoxW(0, text, title, style)

    root = Mbox('Your title', 'Your text', 1)

我一直在 -

NameError: name 'root' is not defined 

1 个答案:

答案 0 :(得分:0)

导入tkinter并将根变量设置为Tk()

from tkinter import *

root = Tk()