mahes
mahes

Reputation: 1152

Python Tkinter message box with multiple text

https://i.sstatic.net/cM0jq.png
How can I make the text on the right hand side(stored in variable msg2) to start from the top, ie same horizontal level as message on left hand side(msg) Here is my code

from Tkinter import *
top = Tk()
msg = """I very soon decided that until I had done something towards naming and describing the most important groups in my collection, and had worked out some of the more interesting problems of variation and geographical distribution (of which I had had glimpses while collecting them), I would not attempt to publish my travels.GoodBye!!"""
w= Message(top,text=msg)
msg2="""I feel bound to give them full satisfaction on this point"""
v= Message(top,text=msg2)
w.grid(row=0,column=0)
v.grid(column=1,row=0)

top.mainloop()

Upvotes: 1

Views: 1801

Answers (1)

falsetru
falsetru

Reputation: 369424

Use sticky option (See grid documentation):

w.grid(row=0, column=0, sticky=N)
v.grid(row=0, column=1, sticky=N)

Upvotes: 1

Related Questions