LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-05-2004, 07:57 AM   #1
jeffsouza
LQ Newbie
 
Registered: Jul 2003
Posts: 7

Rep: Reputation: 0
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()
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Method Not Allowed: The requested method POST is not allowed for the URL /writedhcp.p WiWa Linux - Networking 15 01-06-2011 01:20 PM
Tkinter cammet Fedora 4 01-21-2006 05:50 PM
Python and Tkinter 1337 Twinkie Fedora 2 08-03-2004 11:35 AM
Python: Tkinter. Chu Programming 0 11-10-2003 01:56 AM
hosts entry for a lan unit with no dns entry linxtc Linux - Networking 1 10-03-2003 08:05 AM


All times are GMT -5. The time now is 01:47 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration