Tkinter - Message

INTRODUCTION

The 'Message' widget is a variant of the 'Label', designed to display multiline messages. The 'Message' widget can wrap text, and adjust its width to maintain a given aspect ratio. The widget can be used to display short text messages, using a single font.


import tkinter as tk

root = tk.Tk()

whatever_you_do = "Whatever you do will be insignificant, " \
"but it is very important that you do it.\n(Mahatma Gandhi)"

msg = tk.Message(root, text=whatever_you_do, bg='lightgreen', font="Times 24 italic")

msg.grid()

root.mainloop()

Selected keyword arguments in Message()

master=root     # the first argument
text="message text"
bg="green"   # set the background color
font="Times 24 italic"