Hi,
i'm kind of new at programming, so i was just wandering if anyone can help me with a little problem that i've been having for a couple of hours now.
i have a piece of code that's was given to me like this and can't be touched:
----------------------------------------------------------
------------------------------------------------------------------
i also have a master class called controller. the problem is in the controller class i want to call the entryframe class so that when i run the code it will create what the code above is going to create, but i don't know how to do that.
i've been trying EntryFrame.__in it__(parent, DIGITS)
but i keep getting the error global name parent is not defined.
i don't know what to do now.
please help.
thanks
phoenix1990
i'm kind of new at programming, so i was just wandering if anyone can help me with a little problem that i've been having for a couple of hours now.
i have a piece of code that's was given to me like this and can't be touched:
----------------------------------------------------------
Code:
DIGITS=4
class EntryFrame(Frame):
"""A widget base class for entering a list of digits
Constructor: EntryFrame(parent, num) - parent is the parent widget
and num is the number of digits to be entered.
"""
----def __init__(self, parent, num):
--------Frame.__init__(self, parent)
--------self.entries = []
--------self.num = num
--------for i in range(num):
------------entry = Entry(self, width=1, font=GUESSFONT)
------------entry.pack(side=LEFT,padx=0)
------------entry.bind("<Key>", self.keyevent)
------------self.entries.append(entry)
--------self.entries[0].focus()
--------self.ok = Button(self, text="Guess", command=self.guess)
--------self.ok.pack(side=LEFT, padx=10)
--------self.cancel = Button(self, text="Clear", command=self.clear)
--------self.cancel.pack(side=LEFT, padx=10)
--------self.statustext = StringVar()
--------Label(self, textvariable=self.statustext,\
--------------anchor=W,width=30).pack(side=LEFT)
--------self.setStatus()
i also have a master class called controller. the problem is in the controller class i want to call the entryframe class so that when i run the code it will create what the code above is going to create, but i don't know how to do that.
i've been trying EntryFrame.__in it__(parent, DIGITS)
but i keep getting the error global name parent is not defined.
i don't know what to do now.
please help.
thanks
phoenix1990
Comment