Frame and text widgets are not displayed.
from tkinter import* root=Tk() fra=Frame(root,height=500,width=500,bg='lightgreen') fra.pack() tex1=Entry(fra,width=20) tex1.pack() tex2=Entry(fra,width=20) tex2.pack() root.mainloop() Add fra.pack_propagate(False) so that the frame does not shrink to the size of the text fields:
from tkinter import* root=Tk() fra=Frame(root,height=500,width=500,bg='lightgreen') fra.pack_propagate(False) fra.pack() tex1=Entry(fra,width=20) tex1.pack() tex2=Entry(fra,width=20) tex2.pack() root.mainloop() And by the way, lightgreen is light green, not blue.
Source: https://ru.stackoverflow.com/questions/825764/
All Articles
fra.packput - Twiss