Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with Tkinter is the fastest and easiest way to create GUI applications. Creating a GUI using Tkinter is an easy task.
Note: For more information, refer to Python GUI – tkinter
The Message widget is used to show the message to the user regarding the behavior of the python application. The message text contains more than one line.
The syntax to use the message is given below.
w = Message( master, options)
- master: This parameter is used to represents the parent window.
- options:There are many options which are available and they can be used as key-value pairs separated by commas.
Following are commonly used Option can be used with this widget :-
- anchor: This option is used to decide the exact position of the text within the space .Its default value is CENTER.
- bg: This option used to represent the normal background color.
- bitmap: This option used to display a monochrome image.
- bd: This option used to represent the size of the border and the default value is 2 pixels.
- cursor: By using this option, the mouse cursor will change to that pattern when it is over type.
- font: This option used to represent the font used for the text.
- fg: This option used to represent the color used to render the text.
- height: This option used to represent the number of lines of text on the message.
- image: This option used to display a graphic image on the widget.
- justify: This option used to control how the text is justified: CENTER, LEFT, or RIGHT.
- padx: This option used to represent how much space to leave to the left and right of the widget and text. It’s default value is 1 pixel.
- pady: This option used to represent how much space to leave above and below the widget. It’s default value is 1 pixel.
- relief: The type of the border of the widget. It’s default value is set to FLAT.
- text: This option used use newlines (“\n”) to display multiple lines of text.
- variable: This option used to represents the associated variable that tracks the state of the widget.
- width: This option used to represents the width of the widget. and also represented in the number of characters that are represented in the form of texts.
- wraplength: This option will be broken text into the number of pieces.
- Create a Yes/No Message Box in Python using tkinter
- Python | Message Encode-Decode using Tkinter
- Python | Issue Warning Message
- Python Program that Sends And Recieves Message from Client
- Python | Prompt for Password at Runtime and Termination with Error Message
- Python PyQt5 – How to change font and size of Status Bar Message
- Python GUI - tkinter
- Python Tkinter - Label
- Python | GUI Calendar using Tkinter
- RadioButton in Tkinter | Python
- Python-Tkinter Scrollbar
- Different messages in Tkinter | Python
- Python: Age Calculator using Tkinter
- Python Tkinter - SpinBox
- Python | after method in Tkinter
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.