Questions tagged [tkmessagebox]

The tkMessageBox is a tkinter module that is used to display message boxes in your applications. This module provides a number of functions that you can use to display an appropriate message.

The tkMessageBox module is used to display message boxes in your applications. This module provides a number of functions that you can use to display an appropriate message.

Some of these functions are showinfo, showwarning, showerror, askquestion, askokcancel, askyesno and askretryignore.

Syntax:

Here is the simple syntax to create this widget:

tkMessageBox.FunctionName(title, message [, options])

Parameters:

FunctionName: This is the name of the appropriate message box function.

title: This is the text to be displayed in the title bar of a message box.

message: This is the text to be displayed as a message.

options: options are alternative choices that you may use to tailor a standard message box. Some of the options that you can use are default and parent. The default option is used to specify the default button, such as ABORT, RETRY, or IGNORE in the message box. The parent option is used to specify the window on top of which the message box is to be displayed.

You could use one of the following functions with dialogue box:

showinfo()

showwarning()

showerror()

askquestion()

askokcancel()

askyesno()

askretrycancel()

85 questions
27
votes
7 answers

Correct way to implement a custom popup tkinter dialog box

I just started learning how to create a custom pop up dialog box; and as it turns out, the tkinter messagebox is really easy to use, but it also does not do too much. Here is my attempt to create a dialog box that will take input and then store that…
George
  • 4,514
  • 17
  • 54
  • 81
14
votes
3 answers

Tkinter/ttk themed Message Box?

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…
Xesa
  • 153
  • 1
  • 1
  • 5
11
votes
1 answer

How can I add a "show details" button to a tkinter messagebox?

I have a Python script which uses tkinter.messagebox to display an error message with traceback details if an unexpected exception occurs. import tkinter.messagebox as tm import traceback try: 1/0 except Exception as error: …
Stevoisiak
  • 23,794
  • 27
  • 122
  • 225
11
votes
2 answers

Tkinter askquestion dialog box

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…
Jeff
  • 633
  • 2
  • 7
  • 10
10
votes
4 answers

closing tkmessagebox after some time in python

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…
Sean Vella
  • 113
  • 1
  • 1
  • 5
8
votes
3 answers

Control Font in tkMessageBox

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,
lpostula
  • 588
  • 1
  • 6
  • 22
6
votes
2 answers

tkinter showerror creating blank tk window

I have a program that needs to display graphical error messages to users. It is a tkinter GUI, so I am using tkinter.messagebox.showerror When I call showerror, it shows the error, but also creates a blank "tk" window, the kind created when an…
Ecko
  • 1,030
  • 9
  • 30
6
votes
1 answer

tkinter tkMessageBox html link

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…
dave
  • 161
  • 2
  • 12
4
votes
2 answers

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 tkMessageBox.showerror() just shows the rocket icon, but…
Grezzo
  • 2,220
  • 2
  • 22
  • 39
4
votes
1 answer

What is the difference between 'askquestion' and 'askyesno' in tkinter?

What is the difference between the askquestion() and askyesno() functions of messagebox in Tkinter? I found those two functions in this website: http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/tkMessageBox.html
whiteSkar
  • 1,614
  • 2
  • 17
  • 30
4
votes
2 answers

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

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!
Fxyang
  • 293
  • 3
  • 6
  • 12
4
votes
2 answers

lift a tkMessageBox

I am using tkMessageBox.showinfo (info at tutorialspoint) to popup warnings in my program. The problem happens only when the warning is called with a second TopLevel window (apart from the main one) on screen: in this case the warning remains hidden…
alessandro
  • 3,838
  • 8
  • 40
  • 59
3
votes
4 answers

How to set the size of tk_messageBox?

I am using a tk_messageBox with a lage message, so I would like to configure the layout of that message dialog. I am using tk_messageBox like this: set status [tk_messageBox -type yesno -icon warning -message "Here goes a text with 50 words"] How…
Vahagn
  • 4,670
  • 9
  • 43
  • 72
3
votes
2 answers

Is there a way to destroy the tkinter messagebox without clicking OK?

I know you can use something like, self.root.after(1000, self.update_clock) But could I some how replace that second function with a function that's similar to messagebox.showinfo.destroy()? I'm basically trying to put these message boxes on a timer…
terratunaz
  • 614
  • 3
  • 9
  • 19
3
votes
2 answers

Using a variable to call a function in Python 3 and tkinter

I have a few different functions that I want to call, but I would like to use a the value of a variable to do it. I'm using buttons in tkinter to change the value of the variable, as well as a button that picks a random variable, and a label to…
DeZeeuw2
  • 33
  • 4
1
2 3 4 5 6