Python Forum

Full Version: method to add entries in multi columns entry frames in self widget
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, Smile
I am creating multi columns entry frames for a software. I had written code given below
    def Batch(self):
        self.top1=Toplevel()
        self.top1.geometry( '600x400+0+0')
        self.top1.resizable(0,0)
        self.top1.title( 'New Batch')
        self.bottomframe=ttk.Frame(self.top1,relief=RAISED,borderwidth=2)
        self.bottomframe.pack(side='bottom',fill=X)
        self.btn_Cancle = ttk.Button( self.bottomframe, height=1, width=6, text='Cancel', font=('rockwell',12,'bold'),bg='gray',fg='white',command=self.top1.destroy)
        self.btn_Cancle.pack(side=RIGHT,padx=5,pady=5)
        self.btn_Done = ttk.Button(self.bottomframe, height=1, width=5, text='Done', font=('rockwell',12,'bold'),bg='gray',fg='white' )
        self.btn_Done.pack( side=RIGHT )
        self.topframe=ttk.Frame(self.top1,relief=RAISED,borderwidth=2,bg='gray')
        self.topframe.pack(side='top',fill=BOTH,expand=True)
        self.NameEntry=ttk.Entry(self.topframe)
        self.NameEntry.grid(row=0,column=1)
        self.NameEntry.pack()
I have to create 2 columns frames having entries.
Arrow How I give label to NameEntry?
Arrow How I create sub frames and its entries in 2 columns?
Have a look at this tutorial. Maybe it will help.
It's difficult to say without enough of the class to be able to run and test it but I can tell you for sure the you will need to reference the main or root window when declaring a Toplevel. Something like :

self.top1=Toplevel(root_window)