0

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
Nae
  • 14,209
  • 7
  • 52
  • 79
Miggy
  • 63
  • 2
  • 8
  • Revealing additional code may help. Since you're using the pack geometry manager to display frame3, try doing `frame3.pack(expand=True, fill='both')`. Then if you manually resize the window, you'll notice that frame3 will *grow*, while the others may not. As to a static size... you may want to switch entirely to the grid geometry manager where the size of the grid can be managed. But note that frames by default will take up only as much real estate as their child elements require. – Ron Norris Jan 06 '18 at 21:56
  • The expand works. Thank you! I think I tried this before but I may have done it a tad bit differently. – Miggy Jan 06 '18 at 22:01

1 Answers1

0

frame3.pack(expand=True)

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

Miggy
  • 63
  • 2
  • 8