I cannot get my widgets fit in my computer screen and the layout is not forming as expected.
The two Text
widgets should expand and occupy rest of frame available to them and the second frame which contains response2Field
should fit into screen but it's not happening.
How can I achieve these goals?
# -*- coding: utf-8 -*-
from Tkinter import Tk,Label,Entry,Text,Button,Frame
text = """Python was created in the early 1990s by Guido van Rossum at Stichting
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
as a successor of a language called ABC. Guido remains Python's
principal author, although it includes many contributions from others."""
root = Tk()
request = Frame(root)
response = Frame(root)
response1 = Frame(response)
response2 = Frame(response)
request.grid(row=0,column=0,sticky='news')
response.grid(row=0,column=1)
response1.grid(row=0,column=0,sticky='w')
response2.grid(row=1,column=0,sticky='news')
InputText = Text(request)
InputText.pack(expand='true')
Button(response1,text='Submit',bg='brown',fg='yellow').pack()
response2Field = Text(response2,bg='black',fg='green')
response2Field.pack(expand='true')
InputText.insert("1.0",text)
response2Field.insert("1.0",text)
root.mainloop()
Output: