Questions tagged [tkmessagebox]

1

votes
1

answer
45

Views

The button remains pressed after clicking on “ok” or “cancel” in tk_messagebox

I am using the tk_messageBox for an ok-cancel pop-up info message. The message appears when pressing on a certain button Run, yet after clicking on ok or cancel in the pop up info message the Run button is kept pressed (as illustrated in the image attached ) though enabled you can click it on it aga...
Maha
1

votes
2

answer
57

Views

Tkinter - why I must click the cross 2 times before the window has been closed

When I create a subwindow (toplevel), I can't close the main window with one click. I must to click on cross and OK as many times(+1) as I called function about: import tkMessageBox from Tkinter import * def cross(): if tkMessageBox.askokcancel(u'Quit ATTA Convertor ?', 'Are you sure you want to clo...
Cokotunel
1

votes
1

answer
291

Views

Printing output in a message box

I have code which detects objects in a video and adds each object to a counter. I want to print this counter in a message box. I have tried using tkMessageBox, but the problem is I want the message to say 'number of vehicles: ', counter. I have tried both of the following lines: tkMessageBox.showinf...
Ashir Chima
1

votes
2

answer
2.6k

Views

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 doing this: import tkMessageBox [...stuff...] if (...
JDM
1

votes
1

answer
1.1k

Views

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 window. Now, I've looked at documentation and wasn't...
madprogramer
1

votes
1

answer
484

Views

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 chooses 'No' i'd like to just keep checking the cli...
user1555863
1

votes
1

answer
13.8k

Views

tkinter askyesno message box behaviour

messagebox.askyesno(0.0,''{0}'{1} \n {2}\n'.format(search_analyte.get(),' is not in the database.','Add,if appropriate')) print (str(messagebox.askyesno())) if messagebox.askyesno() == True: open_second() else: open_first() In this snippet of code the askyesno messagebox opens. If I click 'yes' onc...
user1478335
1

votes
1

answer
239

Views

tkMessageBox has extra window in timer program

I'm doing a timer in Python, but my code ends up showing two dialog boxes instead of one when the timer stops. What can I do to avoid having the extra window appear? Code for timer.py below: #!/usr/bin/python import time start = time.time() interval=1 import sys import tkMessageBox def showmessage(...
nathanielng
1

votes
1

answer
2k

Views

Tkinter import problem

I suspect I've got something very simple wrong here but I can't spot what. The following code: import Tkinter as Tk Tk.tkMessageBox.showerror(message='some error') gives: AttributeError: 'module' object has no attribute 'tkMessageBox' Widgets (e.g. Button, Entry) work ok. Interactively I get the sam...
lost
1

votes
1

answer
4.6k

Views

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 so that the user will see them but won't have to d...
terratunaz
1

votes
2

answer
109

Views

IF-ELIF statements nested

I was wondering if there was a better way of writing this. The current code stated below works. i was just wondering if there was a better way. This is for validation. So the if statements check all the mandatory fields and if they are acceptable, then it goes onto the execution code. The issue star...
Aly Abdelaziz
2

votes
2

answer
3.5k

Views

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 can I set the width and height of tk_messageBox here?...
Vahagn
5

votes
1

answer
37.3k

Views

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 tkMessageBox top = Tkinter.Tk() def deleteme(): tkMessageBox...
Jeff
4

votes
1

answer
1k

Views

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 please visit www.blahblubbbb.com') and I want the www.b...
dave
3

votes
1

answer
1.3k

Views

Change tkMessageBox “askyesno” button names

How can I change button names of tkMessagebox.askyesno function? Exactly I want to change yes-button text yes with other and no-button text too
godot
5

votes
2

answer
3k

Views

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
1

votes
2

answer
5.9k

Views

Python TkMessageBox Question not working!

I have a button that writes output to a file. And checks if the file with that filename already exists. It is supposed to ask the user to override or not? But it is not working. If the user says No, then the program will still override the file. This is the code to pop up the MessageBox: if os.path....
Don Code
2

votes
1

answer
772

Views

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
3

votes
2

answer
2.6k

Views

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 behind the second TL window. I tried to call it th...
alessandro
2

votes
1

answer
816

Views

tkmessagebox askquestion with multiple answers

I've been trying to get tkmessagebox.askquestion to ask a question where there are more answers than 'yes' and 'no.' I know that askquestion returns a string 'yes' when yes is clicked, and I'm trying to add more buttons to that dialogue box. Can this even be done with tkmessagebox? How could I add m...
user2327857
2

votes
2

answer
633

Views

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 show the current value (I left this out of the code be...
DeZeeuw2
2

votes
1

answer
94

Views

tkMessageBox popup invisible when run from desktop, visible when run from boot

I am trying to write a program that allows the user to press different buttons in a full screen Tkinter GUI. The operations these buttons preform does not matter for my question, but I am having trouble creating a popup dialogue (askokcancel) to confirm that the user wants to press a button, then ru...
MikeB
3

votes
2

answer
3.1k

Views

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 to keep the message showing for 2 seconds and delet...
Sean Vella
2

votes
0

answer
34

Views

tkMessageBox dialog icon is duplicated in unpredictable ways

Consider: import Tkinter as tk import tkMessageBox root = tk.Tk() root.withdraw() if True: tkMessageBox.askyesno('aa', 'bb?') tkMessageBox.askyesno('aa1', 'bb1?') tkMessageBox.askyesno('aa2', 'bb2?') When the second or the third (the results vary between the runs!) tkMessageBox.askyesno is invoked,...
AlwaysLearning
3

votes
1

answer
2.5k

Views

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 instance of the Tk class is called, like root = Tk(). fr...
Xamuel Schulman
15

votes
3

answer
57k

Views

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 in the username. My question is what is the recomm...
George
9

votes
3

answer
4.1k

Views

Python: 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 is: Windows 10 buttons are plain and blue-lighted, an...
Xesa
4

votes
1

answer
90

Views

“An Error Occurred” when adding a tag description/excerpt

I noticed that the tkmessagebox tag doesn't have an excerpt or description, so I tried to add the following: The tkMessageBox module is part of the Tk GUI toolkit. It handles the creation of pop-up message boxes to show information or present a choice to the user. Unfortunately, I got an 'An Error O...
GoBusto