LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Tkinter Attributeerror : Entry has no __call__ method (https://www.linuxquestions.org/questions/programming-9/tkinter-attributeerror-entry-has-no-__call__-method-142586/)

jeffsouza 02-05-2004 07:57 AM

Tkinter Attributeerror : Entry has no __call__ method
 
This has got me stumped for the last 2 days, someone please help!!
I am creating a GUI interface and I keep getting this error when I press the
"New" button (self.buttonNew)
AttributeError: Entry has no __call__ method

here's the code, can anyone help?

#!/usr/bin/python

from Tkinter import *

class MAINGUI(Frame):
def __init__ (self, parent):

#########################################
# Compose Frames and Subframes #
#########################################

self.myParent = parent

self.mainFrame = Frame(parent)
self.mainFrame.pack(expand=NO, fill=BOTH)

self.subFrame1 = Frame(self.mainFrame, bg=frame1_bg)
self.subFrame1.pack(expand=YES, fill=BOTH)

self.subFrame2 = Frame(self.mainFrame, relief=RIDGE, borderwidth=3, bg=frame2_bg)
self.subFrame2.pack(expand=YES, fill=BOTH)

#########################################
# Buttons #
#########################################

self.buttonNew = Button(self.subFrame1, text='New', height=button_height, width=button_width, \
bg=button_bg, fg=button_fg, state=NORMAL, command=self.clickNew)
self.buttonNew.grid(column=0, row=0, ipadx=button_ipadx, pady=button_pady)

self.buttonSave = Button(self.subFrame1, text='Save', height=button_height, width=button_width, \
bg=button_bg, fg=button_fg, state=DISABLED)
self.buttonSave.grid(column=1, row=0, ipadx=button_ipadx, pady=button_pady)

self.buttonSearch = Button(self.subFrame1, text='Search', height=button_height, width=button_width, \
bg=button_bg, fg=button_fg, state=NORMAL)
self.buttonSearch.grid(column=2, row=0, ipadx=button_ipadx, pady=button_pady)

self.buttonEdit = Button(self.subFrame1, text='Edit', height=button_height, width=button_width, \
bg=button_bg, fg=button_fg, state=DISABLED)
self.buttonEdit.grid(column=3, row=0, ipadx=button_ipadx, pady=button_pady)

self.buttonCalc = Button(self.subFrame1, text='Calculate', height=button_height, width=button_width, \
bg=button_bg, fg=button_fg, state=DISABLED, command=self.clickCalc)
self.buttonCalc.grid(column=4, row=0, ipadx=button_ipadx, pady=button_pady)

self.buttonPrint = Button(self.subFrame1, text='Print', height=button_height, width=button_width, \
bg=button_bg, fg=button_fg, state=DISABLED, command=self.clickPrint)
self.buttonPrint.grid(column=5, row=0, ipadx=button_ipadx, pady=button_pady)

self.buttonQuit = Button(self.subFrame1, text='Quit', height=button_height, width=button_width, \
bg=button_bg, fg=button_fg, command=self.clickQuit)
self.buttonQuit.grid(column=6, row=0, ipadx=button_ipadx, pady=button_pady)


#################################################
# Source Analysis Labels and Entry's #
#################################################

self.labelSourcenumber = Label(self.subFrame2, text="Source Number", bg=label_bg, fg=label_fg)
self.labelSourcenumber.grid(column=0, row=0, sticky=W, pady=label_pady)

self.entrySourcenumber = Entry(self.subFrame2, width=entry_width, state=DISABLED)
self.entrySourcenumber.grid(column=1, row=0, pady=entry_pady)

self.labelChecksource = Label(self.subFrame2, text="Check Source", bg=label_bg, fg=label_fg)
self.labelChecksource.grid(column=0, row=1, sticky=W, pady=label_pady)

self.entryChecksource = Entry(self.subFrame2, width=entry_width, state=DISABLED)
self.entryChecksource.grid(column=1, row=1, pady=entry_pady)

self.labelBkgcount = Label(self.subFrame2, text="Background Count", bg=label_bg, fg=label_fg)
self.labelBkgcount.grid(column=2, row=1, sticky=W, pady=label_pady)

self.entryBkgcount = Entry(self.subFrame2, width=entry_width, state=DISABLED)
self.entryBkgcount.grid(column=3, row=1, pady=entry_pady)

self.labelWipecount = Label(self.subFrame2, text="Wipe Count", bg=label_bg, fg=label_fg)
self.labelWipecount.grid(column=4, row=1, sticky=W, pady=label_pady)

self.entryWipecount = Entry(self.subFrame2, width=entry_width, state=DISABLED)
self.entryWipecount.grid(column=5, row=1, pady=entry_pady)

self.labelResult = Label(self.subFrame2, text="Result", bg=label_bg, fg=label_fg)
self.labelResult.grid(column=6, row=1, sticky=W, pady=label_pady)

self.entryResult = Entry(self.subFrame2, width=entry_width, state=DISABLED)
self.entryResult.grid(column=7, row=1, pady=entry_pady)

def clickQuit(self):
self.myParent.destroy()

def clickCalc(self):
self.buttonQuit.configure(state=DISABLED)

def clickPrint(self):
self.buttonQuit.configure(state=NORMAL)

def clickNew(self):
self.frame2Enable()

def frame2Disable2():
self.entrySourcenumber(state=DISABLED)
self.entryChecksource(state=DISABLED)
self.entryBkgcount(state=DISABLED)
self.entryWipecount(state=DISABLED)
self.entryResult(state=DISABLED)

def frame2Enable(self):
self.entrySourcenumber(state=NORMAL)
self.entryChecksource(state=NORMAL)
self.entryBkgcount(state=NORMAL)
self.entryWipecount(state=NORMAL)
self.Result(state=NORMAL)

root = Tk()
MainGUI = MAINGUI(root)
root.mainloop()


All times are GMT -5. The time now is 11:43 PM.