Hi,
I am creating a gui with tkinter. I am facing some issues while attempting to place widgets on a grid. The issues are:
1. All three rows are showing up at the bottom. I want them vertically centered.
2. In the last of three rows, the button "a" is taking a lot more space than button "b" despite the fact that columnspan is 2 for both.
Here is the code.
![[Image: nfIbq7X]](https://imgur.com/nfIbq7X)
Version information: python 3.4.3, tkinter 8.6
I appreciate the cooperation of forum members.
I am creating a gui with tkinter. I am facing some issues while attempting to place widgets on a grid. The issues are:
1. All three rows are showing up at the bottom. I want them vertically centered.
2. In the last of three rows, the button "a" is taking a lot more space than button "b" despite the fact that columnspan is 2 for both.
Here is the code.
from tkinter import * from tkinter import ttk root = Tk() root.title("Unit-20180109") frame1 = ttk.Frame(root, padding="10 10 10 10") frame1.grid(column=0, row=0, sticky=(N, W, E, S)) frame1.columnconfigure(0, weight=1) frame1.rowconfigure(0, weight=1) notebook1 = ttk.Notebook(frame1, width="800", height="600") screen1 = ttk.Frame(notebook1) notebook1.add(screen1, text="screen 1") notebook1.grid() screen1.grid_columnconfigure(0, weight=1) screen1.grid_rowconfigure(0, weight=1) combobox1var = StringVar() combobox1=ttk.Combobox(screen1, textvariable=combobox1var, values=("Provide an input ...", "a", "b", "c", "d", "e", "f"), state="readonly" ) combobox1.current(0) combobox1.grid(padx=10, row=3, column=0, rowspan=1, columnspan=4, sticky="new" ) entry1var=StringVar() entry1=ttk.Entry(screen1, textvariable=entry1var) entry1.grid(padx=10, row=4, column=0, rowspan=1, columnspan=4, sticky="new") button1= ttk.Button(screen1, text="a") button2= ttk.Button(screen1, text="b") button1.grid(padx=10, row=5, column=0, rowspan=1, columnspan=2, sticky="new") button2.grid(padx=10, row=5, column=2, rowspan=1, columnspan=2, sticky="new") root.mainloop()Here is the output at the moment.
Version information: python 3.4.3, tkinter 8.6
I appreciate the cooperation of forum members.