Python Gui-tkinter Tkmessagebox

Source: Internet
Author: User

The Python gui-tkinter tkmessagebox:tkmessagebox module is used to display message boxes in your application. This module provides a feature that you can use to display the appropriate message

The Tkmessagebox module is used to display message boxes in your application. This module provides a feature that you can use to display the appropriate message.

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

Method:

Here is a simple syntax to create this widget:

Tkmessagebox.functionname (title, message [, Options])
Parameters:
    • FunctionName: This is the name of the corresponding message box function.

    • Title: This is the text that is displayed in a message box in the title bar.

    • Message: This is the text to display as messages.

    • Options: Option has an alternative that you can use to customize a standard message box. Some of the options you can use are default and parent. The default option is to specify the default button, such as Abort, retry, or ignore in the message box. The parent option is used to specify the top-level window on the message box to display.

You can use one of the following features of the dialog box:

    • Showinfo ()

    • Showwarning ()

    • ShowError ()

    • Askquestion ()

    • Askokcancel ()

    • AskYesNo ()

    • Askretrycancel ()

Example:

Try the following example yourself:

Import Tkinterimport tkmessageboxtop = tkinter.tk () def hello ():   tkmessagebox.showinfo ("Say hello", "Hello World") B1 = Tkinter.button (top, Text = "Say Hello", command = Hello) b1.pack () Top.mainloop ()

This will produce the following results:

 

  

Python Gui-tkinter Tkmessagebox

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.