messagebox

Change words on tkinter Messagebox buttons

∥☆過路亽.° 提交于 2019-12-01 05:55:47
I'm using tkinter's "askokcancel" message box to warn the user, with a pop-up, of an irreversible action. from tkinter import Tk Tk().withdraw() from tkinter.messagebox import askokcancel askokcancel("Warning", "This will delete stuff") I'd like to change the text of the 'OK' button (from 'OK') to something like 'Delete', to make it less benign-looking. Is this possible? If not, what is another way to achieve it? Preferably without introducing any dependancies... No, there is no way to change the text of the buttons for the built-in dialogs. Your best option is to create your own dialog. It's

Teardown a MessageBox programmatically without user input

我是研究僧i 提交于 2019-12-01 05:21:05
I'm using a MessageBox from time to time to pop up alert messages for the user. My particular application can be setup to run remotely so there are times where the user is in front of the computer and other times where the user may not be in front of the computer for hours or even days. Sometimes I popup an alert message using MessageBox but after some period of the time the alert is no longer relevant. For example, I popup an alert that a task can't be completed because of some criteria not being met. A few minutes later that criteria is met and the task begins. That MessageBox is no longer

Teardown a MessageBox programmatically without user input

▼魔方 西西 提交于 2019-12-01 04:11:53
问题 I'm using a MessageBox from time to time to pop up alert messages for the user. My particular application can be setup to run remotely so there are times where the user is in front of the computer and other times where the user may not be in front of the computer for hours or even days. Sometimes I popup an alert message using MessageBox but after some period of the time the alert is no longer relevant. For example, I popup an alert that a task can't be completed because of some criteria not

Change words on tkinter Messagebox buttons

故事扮演 提交于 2019-12-01 03:48:48
问题 I'm using tkinter's "askokcancel" message box to warn the user, with a pop-up, of an irreversible action. from tkinter import Tk Tk().withdraw() from tkinter.messagebox import askokcancel askokcancel("Warning", "This will delete stuff") I'd like to change the text of the 'OK' button (from 'OK') to something like 'Delete', to make it less benign-looking. Is this possible? If not, what is another way to achieve it? Preferably without introducing any dependancies... 回答1: No, there is no way to

tkinter showerror creating blank tk window

雨燕双飞 提交于 2019-12-01 03:30:22
问题 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() . from tkinter.messagebox import showerror showerror(title = "Error", message = "Something bad happened") Produces How can I make this blank window not appear? 回答1: from Tkinter import * from

Show a message box from a class in c#?

丶灬走出姿态 提交于 2019-12-01 02:42:15
How do you get a class to interact with the form to show a message box? using System.Windows.Forms; ... MessageBox.Show("Hello World!"); System.Windows.MessageBox.Show("Hello world"); //WPF System.Windows.Forms.MessageBox.Show("Hello world"); //WinForms Try this: System.Windows.Forms.MessageBox.Show("Here's a message!"); using System.Windows.Forms; public class message { static void Main() { MessageBox.Show("Hello World!"); } } 来源: https://stackoverflow.com/questions/715206/show-a-message-box-from-a-class-in-c

System.Windows.MessageBox doesn't wait for user input before going poof!

坚强是说给别人听的谎言 提交于 2019-12-01 02:29:10
...and it makes no sense why. T-T In my Application_Startup event handler I have code that looks kinda like this: private void Application_Startup(object sender, StartupEventArgs e) { string errorMessage; if(CheckStartUpConditions(out errorMessage)) { (new MainWindow()).Show(); } else { MessageBox.Show(errorMessage, "Application Startup", MessageBoxButton.OK, MessageBoxImage.Error); Shutdown(); } } private bool CheckStartUpConditions(out string errorMessage) { errorMessage = string.Empty; if(...) errorMessage += "Please login to xxx. "; if(...) errorMessage += "Please install xxx."; if(string

How do I create a Delayable count down msg box, which triggers bat file

徘徊边缘 提交于 2019-12-01 01:12:46
Hi I'm attempting to create a Message box with a "DELAY" button If the user does not press the Delay button the script will launch a batch file (or command) So it should go like this: Hello User Your Administrator has requested you to log out of this application after work, we have detected you are still using the program, please press Delay if you are still at your machine. Ideally, I would like it to detect when a certain program is active, and only activate if it is Thanks Here is the final version @if (@CodeSection == @Batch) @then @echo off setlocal for /f %%I in ('forfiles /p "%~dp0." /m

System.Windows.MessageBox vs System.Windows.Forms.MessageBox

你说的曾经没有我的故事 提交于 2019-11-30 21:48:52
问题 I am having trouble finding out what the key differences are between the two message boxes. What is the difference between System.Windows.MessageBox and System.Windows.Forms.MessageBox ? 回答1: System.Windows.MessageBox was added with WPF, and exists within the WPF assemblies (PresentationFramework.dll). System.Windows.Forms.MessageBox was added with Windows Forms, and exists within the Windows Forms assemblies. If your program is a Windows Forms program, I would use the latter ( System.Windows

How do I create a Delayable count down msg box, which triggers bat file

不打扰是莪最后的温柔 提交于 2019-11-30 20:53:22
问题 Hi I'm attempting to create a Message box with a "DELAY" button If the user does not press the Delay button the script will launch a batch file (or command) So it should go like this: Hello User Your Administrator has requested you to log out of this application after work, we have detected you are still using the program, please press Delay if you are still at your machine. Ideally, I would like it to detect when a certain program is active, and only activate if it is Thanks Here is the