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
1
vote
1 answer

is Tk().withdraw() suitable to run from a thread?

I am implementing a clipboard monitor in my python app. If the copied text meets certain requirements, i want to show the user a dialog. if the user clicks "Yes" i'd like to trigger a function - in this case webui.app.add_internal(cb) . If the user…
user1555863
  • 2,567
  • 6
  • 35
  • 50
1
vote
1 answer

Tkinter, tkmessagebox keeps sending me to the root

I'm having a problem. Now I have a root window and a couple of "TopLevel's". But every time any window triggered by "tkmessagebox" gets executed, the message box appears and the root window gets sent to front. But I want it to stay at the current…
madprogramer
  • 599
  • 3
  • 12
  • 36
1
vote
2 answers

Using tkMessageBox without importing Tkinter

I'm writing a module where I want to support popup dialogs to indicate errors, but I don't need or want a root window (because I want the module to be independent of the main GUI and share-able between multiple calling applications). I tried simply…
JDM
  • 1,709
  • 3
  • 25
  • 48
1
vote
1 answer

tkMessageBox

Can anybody help me out in how to activate 'close' button of askquestion() of tkMessageBox??
user46646
  • 153,461
  • 44
  • 78
  • 84
0
votes
1 answer

What is the correct value to use for the `default` option in tkinter.messagebox`?

I cannot get the default option of tkinter.messagebox to work. May I know what is the correct value to use for the default option? Sample code: import tkinter as tk import tkinter.messagebox as messagebox root = tk.Tk() def confirmExit(): #…
Sun Bear
  • 7,594
  • 11
  • 56
  • 102
0
votes
1 answer

Unable to import tkinter.messagebox as "tk.messagebox"

In my code, I have imported the main tkinter modules using the line: import tkinter as tk I can then reference tkinter modules for example as tk.Button(). I would like to also import the tkinter.messagebox module, which I am aware must be imported…
jstri
  • 3
  • 1
0
votes
1 answer

Change Font and Size of a Tkinter Messagebox

i have a small Question and i finding no answer in the internet. I want to change the font and fontsize of all Tkinter Messageboxes. Maybe it would be possible if i change something in the libary but i dont now how. Maybe somebody have an…
0
votes
1 answer

How to continue a message box?

I want to write a code that continues the message box after receiving an answer. for example: If they answer yes they get another message box, and same applies for no. I'm not sure how to word it correctly i hope it makes sense. I've tried with…
0
votes
2 answers

Python - tkinter.messagebox cannot see title and showerror icon in macOS

I use tkinter to do GUI. When use messagebox, that can not see title and showerror icon is a file, just like that: enter image description here This is my env: macOS / windows 10 python 3.8.13 tk 8.6 And this is my code import tkinter from…
Kenisnotme
  • 13
  • 4
0
votes
0 answers

tkinter.messagebox doesn't retrigger in my while loop

I'm a beginner programmer and I'm trying to write some code that would show a messagebox whenever my battery level gets to either 1% or 100%. With the code below, I'm able to get the messagebox whenever I run the program at the same time as when my…
0
votes
1 answer

Tkinter get rid of the python icon in messagebox tkinter

How can I get rid of the Python (or matplotlib) icon when running this code? Even when I add icon='info', I still get the rocket with the python logo. Please check the photo in reference. from tkinter import * import tkinter as tk from tkinter…
0
votes
2 answers

How do I make the messagebox appear after the conditions are met?

I am trying to create a login screen via Tkinter, and I want the messagebox to display a message when the user has entered the correct username and password, or hasn't entered it correctly. When I run the program and enter the username and password,…
0
votes
1 answer

Command execution on closing "X" Tkinter MessageBox

I am trying to restart my main GUI/Halt the program flow when I Click on the "X" button in my tkinter messagebox . Any idea how can I do this ? PS: I have read the many threads about closing the main GUI itself but nothing specific to messagebox By…
0
votes
0 answers

How do i make tkinter messagebox pop after an if statement is met? how do I make the program constantly check if somebody has won.?

I am making a tic tac toe game, and I would like for the message box to pop up when the win condition has been met. But right now I have to click an additional time before the message box opens. how do I make the message box open without having to…
Kira
  • 1
  • 1
0
votes
1 answer

Python 3 - Tkinter, MessageBox popsup when program is run not on button press

I have a small issue for which I can`t find the reason. I have the following GUI, and it pops the message box when I run it, even though it is inside a procedure which is triggered only on button press. Tried even creating a secondary function which…
Iura Rusu
  • 95
  • 2
  • 11