I'm having a problem with dealer_score_no.grid_propagate(0)
and player_score_no.grid_propagate(0)
which are the scores for the dealer and player respectively. I experimented with resizing the font, or removing the score labels during the game and what I get is bouncing rows all around. I tried configuring the rows' weights, the problem is I don't really know which weights I need. I'm guessing I'm doing something wrong. I found a way around it by just ditching the resizing, and simply removing the textvariables assigned to them (badly named, I know) and resetting the text to an empty string, which worked fine. No more bouncing rows. But I still want to know how to use the weight and grid_propagate(0)
options.
felt = tkinter.Frame(mainWindow,
bg=FELT_COLOR) # , relief='groove', borderwidth='3')
felt.grid(row=1, column=0, sticky='wens', columnspan=3)
# Dealer cards and score area
dealer_score_label = tkinter.IntVar()
dealer_card_frame = tkinter.Frame(felt, height=card_frame_height, width=800,
background=FELT_COLOR, bd=0, relief="groove")
dealer_card_frame.grid(row=0, column=1, columnspan=3, padx=400, sticky='w')
dealer_score_obj = tkinter.Label(felt, text='',
background=FELT_COLOR, fg=themes[theme]['card_frame_lbl_fg'])
dealer_score_obj.grid(row=1, column=1, columnspan=3, sticky='n', pady=4)
dealer_score_obj.place()
dealer_score_no = tkinter.Label(felt,
font=font.Font(size=18), background=FELT_COLOR,
fg=themes[theme]['card_frame_lbl_fg'])
dealer_score_no.grid(row=2, column=1, columnspan=3, sticky='n', pady=8)
dealer_score_no.grid_propagate(0)
# Player's score area
player_score_label = tkinter.IntVar()
player_score_obj = tkinter.Label(felt, text='',
background=FELT_COLOR, fg=themes[theme]['card_frame_lbl_fg'])
player_score_obj.grid(row=3, column=1, columnspan=3, sticky='sew', pady=(200, 0))
player_score_no = tkinter.Label(felt,
font=font.Font(size=18), background=FELT_COLOR,
fg=themes[theme]['card_frame_lbl_fg'])
player_score_no.grid(row=4, column=1, columnspan=3, sticky='n', pady=8)
player_score_no.grid_propagate(0)
player_card_frame = tkinter.Frame(felt, height=card_frame_height, width=800,
background=FELT_COLOR, bd=0, relief="groove")
player_card_frame.grid(row=5, column=1, columnspan=3, padx=400, sticky='sw')
betting_frame = tkinter.Frame(felt, height=100, bg=FELT_COLOR, width=int(mainWindow.winfo_screenwidth() * 0.66))
betting_frame.grid(row=6, column=1, columnspan=3, sticky='ew')
felt.config(height=felt.winfo_reqheight())```
[![This is how it looks like.][1]][1]
[1]: https://i.stack.imgur.com/Ae4pt.png