У меня есть код, как показано ниже.Я хочу убедиться, что textArea1 будет рядом с textAreaLabel1, но сейчас это далеко налево, потому что первый объект, который находится в строке позиции = 0, столбце = 0 и очень длинный.Как я могу сделать это прямо рядом друг с другом?

import tkinter as tk
class MainFrame(tk.Tk):
""" This is main class for managing different views(windows) """
#-------------------------------------------------------------------------------------
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
# init main frame
container = tk.Frame(self, width=500, height=300)
# container.pack(side="top", fill="both", expand = True)
# stores starting options
self.checkBoxDict = dict()
container.grid_rowconfigure(0, weight=1)
container.grid_columnconfigure(0, weight=1)
# add start info
entryInfo = tk.Label(text = "Choose your settings, one window running different algorithm will be open for every check box checked")
entryInfo.grid(row = 0, column = 0)
# add rest of controlers
self.addControlers()
#-------------------------------------------------------------------------------------
def addControlers(self):
"""sets rest of gui"""
info = tk.Label(text = "Choose what algorithms(crossover) you want to compare")
info.grid(row = 1, column = 0, sticky="W")
textAreaLabel1 = tk.Label(text = "How big population ? (best 100-500)")
textAreaLabel1.grid(row = 3, column = 0, sticky="w")
textArea1 = tk.Entry()
textArea1.grid(row = 3, column = 1,sticky="w" )
textAreaLabel2 = tk.Label(text = "How many points ? (best 20-50)")
textAreaLabel2.grid(row = 4, column = 0, sticky="w")
textArea2 = tk.Entry()
textArea2.grid(row = 4, column = 1, sticky="W")
self.checkBoxDict["ramdom"] = tk.BooleanVar()
checkButton1 = tk.Checkbutton( text="Pure randomness approach", variable=self.checkBoxDict["ramdom"])
checkButton1.grid(row = 5, column = 0, sticky="W")
self.checkBoxDict["pmx"] = tk.BooleanVar()
checkButton2 = tk.Checkbutton( text="PMX crossover", variable=self.checkBoxDict["pmx"])
checkButton2.grid(row = 6, column = 0, sticky="W")
self.checkBoxDict["mutation"] = tk.BooleanVar()
checkButton3 = tk.Checkbutton( text="Only mutation no crossover", variable=self.checkBoxDict["mutation"] )
checkButton3.grid(row = 7, column = 0, sticky="W")
#-------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------------
app = MainFrame()
app.mainloop()
ОБНОВЛЕНИЕ Этоначал работать на меня, как я хотел
...
container.grid_rowconfigure(0, weight=1)
container.grid_columnconfigure(2, weight=1)
# add start info
entryInfo = tk.Label(text = "Choose your settings, one window running different algorithm will be open for every check box checked")
entryInfo.grid(row = 0, column = 0, columnspan=10)
# add rest of controlers
self.addControlers()
#-------------------------------------------------------------------------------------
def addControlers(self):
"""sets rest of gui"""
info = tk.Label(text = "Choose what algorithms(crossover) you want to compare")
info.grid(row = 1, column = 0, sticky="w", columnspan=10)
textAreaLabel1 = tk.Label(text = "How big population ? (best 100-500)")
textAreaLabel1.grid(row = 3, column = 0, sticky="w")
textArea1 = tk.Entry()
textArea1.grid(row = 3, column = 1,sticky="w")
textAreaLabel2 = tk.Label(text = "How many points ? (best 20-50)")
textAreaLabel2.grid(row = 4, column = 0, sticky="w")
textArea2 = tk.Entry()
textArea2.grid(row = 4, column = 1, sticky="W")
self.checkBoxDict["ramdom"] = tk.BooleanVar()
checkButton1 = tk.Checkbutton( text="Pure randomness approach", variable=self.checkBoxDict["ramdom"])
checkButton1.grid(row = 5, column = 0, sticky="W")
self.checkBoxDict["pmx"] = tk.BooleanVar()
checkButton2 = tk.Checkbutton( text="PMX crossover", variable=self.checkBoxDict["pmx"])
checkButton2.grid(row = 6, column = 0, sticky="W")
self.checkBoxDict["mutation"] = tk.BooleanVar()
checkButton3 = tk.Checkbutton( text="Only mutation no crossover", variable=self.checkBoxDict["mutation"] )
checkButton3.grid(row = 7, column = 0, sticky="W")
startButton = tk.Button(text = "Start", bd = 3, bg = "#20aa20", command = lambda:self.start())
startButton.grid(row = 8, sticky = "nswe", columnspan=10)
#-------------------------------------------------------------------------------------
