Python - How would I use a single function to get information about the frame in Tkinter
<h1>Python - Events, Frames and Tkinter</h1>

<p>Here I have my GameApplication class which creates and runs the tkinter application. I would like to have it so that I can call the same function from every frame and using that function find out what frame was clicked. I'm only just diving into python now so excuse me if this seems simple.</p>

<p>Thanks for the help in advance.</p>

<pre><code># Import needed classes.
from tkinter import *


# Create the GameApplication class to run the GUI
class GameApplication(Frame):
    def __init__(self, master=None):
        super().__init__(master)
        self.grid()
        self.grid_rowconfigure(0, weight=1)
        self.grid_columnconfigure(0, weight=1)

        self.position_1 = Frame(width=100, height=100, bg="#CC0000")
        # This is the Frame I want to get information about.
        self.position_1.bind("&lt;Button-1&gt;", self.callback)
        self.position_1.grid(column=0, row=0)

        self.position_2 = Frame(width=100, height=100, bg="#00CC00")
        # And this one too.
        self.position_2.bind("&lt;Button-1&gt;", self.callback)
        self.position_2.grid(column=1, row=0)

    def callback(self, event):
        print("?")

if __name__ == "__main__":
    root = Tk()
    app = GameApplication(master=root)
    root.mainloop()
</code></pre>