Skip to content Skip to sidebar Skip to footer

Why Can't I Change The Icon On A Tkmessagebox.askyesno() On Os X?

tkMessageBox.askyesno('Title', 'Message', icon=tkMessageBox.WARNING) on OS X just gives me the rocket icon. I know there is some weirdness with OS X and tkMessageBox icons because

Solution 1:

I found a solution:

tkMessageBox.askretrycancel(title, message, type=tkMessageBox.YESNO)

seems to work, but both buttons presses return False, so it's not of any use.

tkMessageBox.showwarning(title, message, type=tkMessageBox.YESNO)

does also work work, but be aware that it returns 'yes' or 'no', not True or False. It's the only real option though.


I would still be interested if anyone can tell me whether it is a bug.

Solution 2:

You can use icon='warning' instead of icon=tkMessageBox.WARNING

I just tried that on Windows. Sorry I don't have OSX to test

Post a Comment for "Why Can't I Change The Icon On A Tkmessagebox.askyesno() On Os X?"