如何在下面的代码中围绕网格移动按钮?每当我尝试更改行和列时,什么都没有发生。另外,是否有可能使文本框更大,以便我可以在那里放置句子,因为现在文本已经脱离了盒子?
from Tkinter import*
class Application(Frame):
def __init__(self, master):
global e
global b
Frame.__init__(self, master)
self.grid()
b=Entry(bg = 'yellow')
b.grid(row=19, column=40)
e=Entry(bg = 'grey')
e.grid(row=15, column = 1000)
self.buttons()
def instructions(self):
b.insert(0, 'HI')
def start_game(self):
e.insert(0, "I want to put a sentance here")
def buttons(self):
self.b = Button(self, text = "Instructions", command = self.instructions)
self.b.grid(row=15, column = 25)
self.b1 = Button(self, text = "Start Game", command = self.start_game)
self.b1.grid(row=10, column = 10)
root = Tk()
root.title("Box")
root.geometry("400x400")
app=Application(root)
root.mainloop()