I have two frames in the root. And I want to add a button in one of the frames. Both frames have different background colours. When I try to add a button in any of them, the frame that contains the button disappears.
Without button
from tkinter import *
root = Tk()
root.geometry("1600x800+0+0")
root.title("ABC")
Rf = Frame(root, width=100, height=800, bg="black")
Rf.pack(side=RIGHT)
Lf = Frame(root, width=1500, height=800, bg="green")
Lf.pack(side=LEFT)
root.mainloop()
Which results in...
With button
But after adding the button, with the following code...
from tkinter import *
root = Tk()
root.geometry("1600x800+0+0")
root.title("ABC")
Rf = Frame(root, width=100, height=800, bg="black")
Rf.pack(side=RIGHT)
Lf = Frame(root, width=1500, height=800, bg="green")
Lf.pack(side=LEFT)
b1 = Button (Rf, text="Load", fg="red", bg="black")
b1.pack(side=LEFT)
root.mainloop()
I get...
Now the button is visible but the frame and background colours are gone. What am I doing wrong?
Thanks for your help!