hi.
i'm a beginner and i'm trying to get the hang of classes and functions. my
code looks like this:
<code>
class showRecord(main):
def __init__(self):
global gmax
#now to create the screen by placing all the widgets
rt = Tk()
showbuttons()
#call the scroller to DoSomething
scroll()
def showbuttons(self):
# NAVIGATION BAR------
NavBut1 = Button(rt, text="|<", width=6, height=2,
bg="DarkSeaGreen", fg="Black")
NavBut1.grid(row=10, column=20, padx=6, pady=6, columnspan=3)
NavBut2 = Button(rt, text="<<", width=6, height=2,
bg="DarkSeaGreen", fg="Black")
NavBut2.grid(row=10, column=25, padx=6, pady=6, columnspan=3)
#widget bindings
NavBut2.bind('<Button-1>', lambda e:GoPrev(ctr))
</code>
my problem is at the 6th line: showbuttons()
the error says "global name "showbuttons" is not defined.... but it's not a
global variable. what am i doing wrong?
also, should i say ...
def showbuttons(self):
or
def showbuttons(self, showRecord):
thank you.
--
http://mail.python.org/mailman/listinfo/python-list