tkinter.Message.pack


Definition
The syntax create the message Box.

Syntax
tkinter.Message().pack()

Options
  • Message.pack(
  • after=widget - pack it after you have packed widget
  • anchor=NSEW (or subset) - position widget according to given direction
  • before=widget - pack it before you will pack widget
  • expand=bool - expand widget if parent size grows
  • fill=NONE or X or Y or BOTH - fill widget if widget grows
  • in=master - use master to contain this widget
  • in_=master - see 'in' option description
  • ipadx=amount - add internal padding in x direction
  • ipady=amount - add internal padding in y direction
  • padx=amount - add padding in x direction
  • pady=amount - add padding in y direction
  • side=TOP or BOTTOM or LEFT or RIGHT - where to add this widget.
  • )
Examples
The message is displayed through Message() .
 >>> import tkinter
>>> from tkinter import*
>>> master=tkinter.Tk()
>>> message=Message(master, text="Hello")
>>> message.pack()
>>> 





The positioning the Message.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()




Comments