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