tkmessagebox

Why can't I change the icon on a tkMessagebox.askyesno() on OS X?

醉酒当歌 提交于 2020-08-07 17:58:08
问题 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 tkMessageBox.showerror() just shows the rocket icon, but tkMessageBox.showwarning shows a yellow triangle (with a small rocket in the corner) Is this is a bug? Is there some workaround to get a warning triangle and Yes/No buttons without having to resort to making my own message box window from scratch? 回答1: I found

Why can't I change the icon on a tkMessagebox.askyesno() on OS X?

蓝咒 提交于 2020-08-07 17:50:47
问题 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 tkMessageBox.showerror() just shows the rocket icon, but tkMessageBox.showwarning shows a yellow triangle (with a small rocket in the corner) Is this is a bug? Is there some workaround to get a warning triangle and Yes/No buttons without having to resort to making my own message box window from scratch? 回答1: I found

closing tkmessagebox after some time in python

烈酒焚心 提交于 2020-01-03 16:52:22
问题 I am developing an automated attendance system where when a student scans his RFID tag, his attendance is recorded while showing a welcoming message using a tkmessagebox pop-up. The user will not have control of a mouse or keyboard and I would like to keep the message showing for 2 seconds and delete the message box. Is there a way I can close the tkmessagebox pop-up like proposed? 回答1: I don't think that it can be done with tkMessageBox because this creates a modal dialog, and you do not

Python: Tkinter/ttk themed Message Box

ⅰ亾dé卋堺 提交于 2019-12-30 04:17:26
问题 I started making a GUI with Tkinter and I added the module tkMessageBox as well. But recently I discovered that importing the module ttk gives more 'up-to-date' results: buttons and texts boxes appear with the actual style of the current OS. This is: Windows 10 buttons are plain and blue-lighted, and not those shaded gray blocky buttons from previous versions. But unfortunately, I can't find a way to use this ttk themed widgets on the common Dialog Boxes (the ones which I imported from

Control Font in tkMessageBox

耗尽温柔 提交于 2019-12-19 06:38:10
问题 I would to like to control the font of the text on a tkMessageBox but I can't see any reference of such a stuff. Is it only implemented in Tkinter? Thanks, 回答1: You can configure the font for just dialog boxes by doing the following: from Tkinter import * import tkMessageBox r = Tk() r.option_add('*Dialog.msg.font', 'Helvetica 12') tkMessageBox.showinfo(message='Hello') (Only the option_add invocation is modified from the accepted answer.) 回答2: The following works here. You will need to

Can I adjust the size of message box created by tkMessagebox?

故事扮演 提交于 2019-12-13 01:19:45
问题 I want to create information dialogue with tkMessagebox with a fixed width. I didn't see any options in the tkMessagebox.showinfo function that can handle this. Is there any way? Thanks! 回答1: As far as I'm aware you can't resize the tkMessageBox, but if you're willing to put in the effort you can create custom dialogs. This little script demonstrates it: from tkinter import * #If you get an error here, try Tkinter not tkinter def Dialog1Display(): Dialog1 = Toplevel(height=100, width=100)

Tkinter askquestion dialog box

◇◆丶佛笑我妖孽 提交于 2019-12-09 16:20:04
问题 I have been trying to add an askquestion dialog box to a delete button in Tkinter. Curently I have a button that deletes the contents of a folder once it is pressed I would like to add a yes/no confirmation question. import Tkinter import tkMessageBox top = Tkinter.Tk() def deleteme(): tkMessageBox.askquestion("Delete", "Are You Sure?", icon='warning') if 'yes': print "Deleted" else: print "I'm Not Deleted Yet" B1 = Tkinter.Button(top, text = "Delete", command = deleteme) B1.pack() top

tkinter tkMessageBox html link

自作多情 提交于 2019-12-07 05:23:34
问题 I got a tkMEssagebox.showerror showing up in a python tkinter application, when somebody failed to login with the application. Is it possible to have a url link in the tkMessageBox.showerror? ie. tkMessageBox.showerror("Error","An error occured please visit www.blahblubbbb.com") and I want the www.blahblubbbb.com to be clickable?! 回答1: Short answer: "No!" message is a simple string, no interpretation like in some widgets of other frameworks is done. Longer answer: You could e.g. subclass

Python Notification Popup that disappears

一个人想着一个人 提交于 2019-12-06 16:19:14
问题 Is there a way to create a pop up that disappears after a certain number of seconds or minutes. I only find examples of people having trouble with popups that disappear when they are not supposed to. I have found tkMessage box but when I test something with show info it is giving me two boxes and you have to click to get out of it. It's quite distracting. I'd rather have something that disappears, for example, the python program see's that a new email has arrived in and then creates a pop up,

tkinter tkMessageBox html link

泄露秘密 提交于 2019-12-05 10:48:11
I got a tkMEssagebox.showerror showing up in a python tkinter application, when somebody failed to login with the application. Is it possible to have a url link in the tkMessageBox.showerror? ie. tkMessageBox.showerror("Error","An error occured please visit www.blahblubbbb.com") and I want the www.blahblubbbb.com to be clickable?! Short answer: "No!" message is a simple string, no interpretation like in some widgets of other frameworks is done. Longer answer: You could e.g. subclass+monkeypatch, to provide such feature. 来源: https://stackoverflow.com/questions/13508043/tkinter-tkmessagebox-html