-2
複数のエントリがある場合は、各エントリに固有のボタンを使用して入力する方法です(ボタンをクリックすると、すべてのエントリが入力されるわけではありません)。ときにたとえば、エントリA、B、D、kはINOUTし、具体的には、一般的に複数のエントリがある場合は、ボタンを使って各tkinterエントリを入力する方法は?
class PageDeg2 (tk.Frame):
def __init__(self, parent, controller):
def add_num(x):
a.insert(16,x)
b.insert(16,x)
c.insert(16,x)
tk.Frame.__init__(self, parent)
mainFunction = tk.Label (self, text = "y = ax^2 + bx + c", font = FONT)
mainFunction.grid (row = 0, column = 0) ####
label1 = tk.Label(self, text = "a = ", font = FONT, fg = 'red')
label1.grid (row = 1, column = 0)
label2 = tk.Label(self, text = "b = ", font = FONT, fg = 'orange')
label2.grid (row = 2, column = 0)
label3 = tk.Label (self, text = "c = ", font = FONT, fg = 'green')
label3.grid (row = 3, column = 0)
a = tk.Entry (self)
a.grid (row = 2, column = 1)
b = tk.Entry (self)
b.grid (row = 1, column = 1)
c = tk.Entry (self)
c.grid (row = 3, column = 1)
sLabel = tk.Label (self, text = "from ", font = FONT)
sLabel.grid (row = 4, column = 0)
start = tk.Entry (self)
start.grid (row = 4, column = 1)
eLabel = tk.Label (self, text = " to ", font = FONT)
eLabel.grid (row = 4, column = 2)
end = tk.Entry (self)
end.grid (row = 4, column = 3)
buttonG = tk.Button (self, text = "Graph") #function o Graph def graph
buttonG.grid (row = 5, column = 2)
buttonBack = tk.Button (self, text = "Back",command = lambda: controller.show_frame (PagePolynomial))
buttonBack.grid (row = 6, column = 2)
Button(self,text='7',width=10,height=5,bg="WHITE",command=lambda:add_num('7')).grid(row=9,column=0,sticky=E+W+N+S)
Button(self,text='8',width=10,height=5,bg="WHITE",command=lambda:add_num('8')).grid(row=9,column=1,sticky=E+W+N+S)
Button(self,text='9',width=10,height=5,bg="WHITE",command=lambda:add_num('9')).grid(row=9,column=2,sticky=E+W+N+S)
Button(self,text='4',width=10,height=5,bg="WHITE",command=lambda:add_num('4')).grid(row=10,column=0,sticky=E+W+N+S)
Button(self,text='5',width=10,height=5,bg="WHITE",command=lambda:add_num('5')).grid(row=10,column=1,sticky=E+W+N+S)
Button(self,text='6',width=10,height=5,bg="WHITE",command=lambda:add_num('6')).grid(row=10,column=2,sticky=E+W+N+S)
Button(self,text='1',width=10,height=5,bg="WHITE",command=lambda:add_num('1')).grid(row=11,column=0,sticky=E+W+N+S)
Button(self,text='2',width=10,height=5,bg="WHITE",command=lambda:add_num('2')).grid(row=11,column=1,sticky=E+W+N+S)
Button(self,text='3',width=10,height=5,bg="WHITE",command=lambda:add_num('3')).grid(row=11,column=2,sticky=E+W+N+S)
Button(self,text='0',width=10,height=5,bg="WHITE",command=lambda:add_num('0')).grid(row=12,column=0,sticky=E+W+N+S)
Button(self,text='C',width=10,height=5,bg="BLUE",command=lambda:e1.delete(0,END)).grid(row=12,column=1,sticky=E+W+N+S)
Button(self,text='.',width=10,height=5,bg="WHITE",command=lambda:add_num('.')).grid(row=12,column=2,sticky=E+W+N+S)
この質問は不明です。何を試しましたか? http://www.stackoverflow.com/help/mcveをお読みください –