I wanted to ask a clever question about using Canvas as a container, but writing my example code I stumbled over something weird. Here is the code so far:
import Tkinter as tk
class CCanvas(tk.Canvas):
def __init__(self,master,*args,**kwargs):
super(CCanvas,self).__init__(master=master,*args,**kwargs)
if __name__ == '__main__':
root= tk.Tk()
cc = CCanvas(root)
cc.pack()
root.mainloop()
Now this code should not do much. The class CCanvas just inherits from Canvas, doesn't implement anything, just calls the constructor of the super-class. I don't see any reason for this not to work. Yet, when I run this, I get the following error:
super(CCanvas,self).__init__(master=master,*args,**kwargs)
TypeError: must be type, not classobj
Can anyone explain this behavior to me and maybe tell me how to fix it?