Tkinter: Creating a static frame size inside a pre-existing frame window

710 Views Asked by At

I have an app that has a frame which houses a gridview of information regarding product data. I want frame3 to have a static window size with a scroll bar. The scroll bar, not implemented yet, will allow the user to scroll down to see the remaining product data not visibly seen inside the static window.

My problem is that frame3 as of right now, doesn't seem to have a visible, static frame size. It just looks like it takes up one row in my overall app gridview, as seen in the picture: picture of current program

I would like the "Bar Code - Product Description ..." section to acquire most of the screen real-state of the app but i can't seem to get it to work. I've tried creating a canvas inside frame3 but it still doesn't work.

Any ideas?

The code below is just a short snippet of my overall application

    frame3 = Frame(self, bg = "black", width = 690, height = 400, borderwidth = 1)
    frame3.pack()


    frame3Label1 = tk.Label(frame3, text="Bar Code", font=NORMAL_FONT, relief = SUNKEN, width = 16)
    frame3Label1.grid(row = 0, column = 0)

    frame3Label2 = tk.Label(frame3, text="Product Description", font=NORMAL_FONT, relief = SUNKEN, width = 30)
    frame3Label2.grid(row = 0, column = 1)

    frame3Label3 = tk.Label(frame3, text="Price", font=NORMAL_FONT, relief = SUNKEN, width = 10)
    frame3Label3.grid(row = 0, column = 2)

    frame3Label4 = tk.Label(frame3, text="Quantity", font=NORMAL_FONT, relief = SUNKEN, width = 8)
    frame3Label4.grid(row = 0, column = 3)

    frame3Label5 = tk.Label(frame3, text="Discount", font=NORMAL_FONT, relief = SUNKEN, width = 8)
    frame3Label5.grid(row = 0, column = 4)

    frame3Label6 = tk.Label(frame3, text="Cost", font=NORMAL_FONT, relief = SUNKEN, width = 10)
    frame3Label6.grid(row = 0, column = 5)

    #Function that creates more labels/entry boxes under these static existing labels
1

There are 1 best solutions below

0
On

frame3.pack(expand=True)

I just used the expand property as per mentioned in a comment