简体   繁体   中英

R tcltk: change the icon of a tkmessage

Does anyone know if there is a way to change the picture icon of a tkmessage? I know there is a way to change the icon of the overall panel using tcl, but what about the message box? For example, can I change the 'Tk' icon to something else?

在此处输入图片说明

Thanks! DD

I don't see any options for changing the icon within a message box. The message box function is a pretty simple, few option tool for a quick message. If you want more functionality than it provides (ie the option to change that icon) then you can create your own dialog box with a label and button to do the job and change the icon the way with a regular window.

kico = 'myicon.ico' # where we have an icon we prefer to use instead of tkinter icon which icon files

i downloaded bitmap icons (probably ibm)

...in the place where establishing a root window i might have this

from Tkinter import * root = Tk() root.wm_iconbitmap(kico) # this seems to overlay in the main application and all child window tkinter dialogs etc

... overlays the tkinter icon in for example tkMessageBox.askokcancel dialog

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM