Okay I am having some weird problems…I created a Named_Button class
class Named_Button(tkinter.Button):
def __init__(self,name='NoName',master,**k):
tkinter.Button.__init__(master,**k)
self.pack()
self.name = name
root = Tk()
Named_Button(root,name='hi',height='4')
root.mainloop()
On trying to create the button I get the following error:
AttributeError: 'Named_Button' object has no attribute 'tk'
Any ideas?
Could you try doing this:
Calling the
Buttonconstructor should probably happen for your subclassed instance, right? And not for themasterobject, whatever that is?