Tkinter Grid Geometry Resizing issue

  python-3.x, tkinter, tkinter-layout

Browse Button in Right Hand side Panel is being separated when resizing the window. I want the whole thing to stay together and resizing equally.

import tkinter as tk
from tkinter import ttk
from tkinter import *

class AppLayout(tk.Tk):
    def __init__(self):
        tk.Tk.__init__(self)

        
        
        self.masterPane = tk.PanedWindow(self )
        self.leftPane   = tk.Frame(self.masterPane,relief = 'raised',bg='black',width =100)
        self.masterPane.add(self.leftPane)
        
        self.rightPane   = tk.Frame(self.masterPane)
        self.masterPane.add(self.rightPane)
        
        self.masterPane.pack(fill = 'both',expand = True)
        


        name_entry    = tk.Entry(self.rightPane,font =('calibre',10,'normal'))
        Browse_Button = tk.Button(self.rightPane,text = 'Browse')
        Upload_Button = tk.Button(self.rightPane,text = 'Upload')
        
        name_entry.grid(row=1,column=1)
        Browse_Button.grid(row=1,column=2)
        Upload_Button.grid(row=1,column=1,pady =(50,0))
        

        self.rightPane.columnconfigure(1, weight=1)
        self.rightPane.rowconfigure(1, weight=1)


app = AppLayout()
app.mainloop()

Source: Python-3x Questions

LEAVE A COMMENT