Using Tkinter I have a Toplevel named self.edit_window, a Frame named frame and a Canvas named canvas. All I want to do is add the frame to the canvas, which I try to do by using the create_window method:
#make canvas
canvas = Tkinter.Canvas(self.edit_window)
#make frame and add to canvas
frame = Tkinter.Frame()
canvas.create_window(0,0, anchor = Tkconstants.NW, window = frame, width = 200, height = 200)
And I get the following error on the create_window call:
TclError: can't use .173048428 in a window item of this canvas
And I have no idea what that means. Any ideas?
The code you supply does not give this error. Are you certain that code is enough to illustrate the problem?
That being said, the error you say you are getting is consistent with trying to add to a canvas a window that is not a sibling or child of the canvas. According to the official tk documentation:
If you make your frame a child of the canvas, this problem will go away (though, strictly speaking, it doesn’t have to be an immediate child).