Python‎ > ‎tkinter‎ > ‎

tkinter.Message


Definition
The method returns with the multitext message in the widget.

Syntax
tkinter.Message

Examples
The message is displayed through Message() .
 >>> import tkinter
>>> from tkinter import*
>>> master=tkinter.Tk()
>>> message=Message(master, text="Hello")
>>> message.pack()
>>> 





The message is scaled inside the grid through Message().grid().
 from tkinter import*
master=Tk()
master.grid()

message1=Message(master,text="M1")
message1.grid(row=1,column=0)

message2=Message(master, text="M2")
message2.grid(row=1,column=2)

message3=Message(master,text="M3")
message3.grid(row=0,column=1)

message4=Message(master,text="M4")
message4.grid(row=2,column=1)

master.mainloop()





The positioning the Message through pack(side=LEFT, RIGHT, TOP, BOTTOM).
from tkinter import*
master=Tk()

message1=Message(master,text="M1")
message1.pack(side=LEFT)

message2=Message(master, text="M2")
message2.pack(side=RIGHT)

message3=Message(master,text="M3")
message3.pack(side=TOP)

message4=Message(master,text="M4")
message4.pack(side=BOTTOM)

master.mainloop()





The method display the Message in Widget through widget default setting.
import tkinter
from tkinter import Message


tkinter.Message(master, text="Python Lake was founded by Adil Waseem with a mission to put all Python code in one website").pack()

master.mainloop







Comments