What is the primary difference between these two functions?
I'm currently working on a program that contains a canvas and a label, the latter is behaving as a button. Now the canvas was placed using .pack() while I used .place() for the label. Additionally the program reads and uses the location of mouse clicks to perform certain actions.
There is currently a bug that causes the program to trigger an unexpected action upon clicking the label, to my surprise upon clicking the label the x and y coordinate of the mouse click are not in reference to the window (as I expected it to be) but rather to the top-left coordinates of the label.
Is there a way to set it so that the label does not modify the x and y coordinate of the mouse click within it?
I'm relatively new to python and this is the first projects I've made using tkinter. If needed I can provide the code upon request.
EDIT: Entire program can be found here. Labels are added starting at line 87:
newgame_Label = Label(parent, anchor=NW, font="Calibri",
text="New Game")
newgame_Label.bind("<Button 1>", self.newgame_Click)
newgame_Label.place(x=450, y=300)
reset_Label = Label(parent, anchor=NW, font="Calibri",
text="Reset Board")
reset_Label.bind("<Button 1>", self.reset_Click)
reset_Label.place(x=450, y=400)
The function initBoard calls the .pack() method on the canvas. The program is a clone of Light's Out, thought it would be a good way of learning python and tkinter.
Alternately I can just not use a label and simply use the create_text method available to a canvas widget, but this would require some workaround to determine if it has been clicked. Mostly interested in finding out why is it that .place() for a Label Widget behaves the way it does event though they share the same frame.