0

enter image description hereHow do I place a button in center of row using grid in tkinter. My tkinter canvas is full screen and I am using grid layout. How do I place things in middle vertically one after other.

    from tkinter import *
    height = Tk.winfo_screenheight(self) 
    width = Tk.winfo_screenwidth(self) 
    self.minsize(width, height)


    self.lab = Label(self,pady=15)
    self.lab.grid(column=0,row=0)


    self.button1 = Button(self, text = "Check",command = self.run_progressbar, font = ('Comic Sans MS',15))
    self.button1.grid(column =0, row = 1)


    self.progress_bar = ttk.Progressbar(self, orient = 'horizontal', length = 286, mode = 'determinate')
    self.progress_bar.grid(column = 0, row = 2, pady  =2)
EXODIA
  • 908
  • 3
  • 10
  • 28
  • No as in that answer dimensions are fixed. All I want is to find a way to center – EXODIA May 10 '20 at 21:26
  • no this doesnt work – EXODIA May 10 '20 at 21:37
  • since the size of tkinter window if max widhth and height doing col=1 doesnt work as we think it will – EXODIA May 10 '20 at 21:38
  • It put entire content to the rightmost part – EXODIA May 10 '20 at 21:58
  • I read and understood the concept of weight. But in this situation since there is only column in a row so weight wont help, it will just occupy the entire space. Please read my question once more to get the idea what I want to achive – EXODIA May 10 '20 at 22:10
  • I've updated the question with an image in my head of what I am trying to achive – EXODIA May 10 '20 at 22:30

0 Answers0