I'm new to tkinter and I'm not 100% sure on how the whole frame, self, etc works.
I have this:
class ScalesPage(Frame):
def GetNotes():
key = KeyEntry.get()
intervals = ScaleEntry.get()
WholeNotes = ['C','C#','D','D#','E','F','F#','G','G#','A','A#','B']*4
Root = WholeNotes.index(key)
Chromatic = WholeNotes[Root:Root+12]
print([Chromatic[i] for i in scales[intervals]])
def __init__(self, parent, controller):
Frame.__init__(self, parent)
global KeyEntry
KeyEntry = Entry(self)
KeyEntry.pack()
global ScaleEntry
ScaleEntry = Entry(self)
ScaleEntry.pack()
ScaleButtonEnter = Button(self, text="Enter", command=GetNotes)
ScaleButtonEnter.pack()
I'm trying to make the ScaleButtonEnter
execute GetNotes()
, but I keep getting the error
NameError: name 'GetNotes' is not defined
I'm assuming I'm missing something easy, but I'm just not familiar enough with tkinter to figure it out.