I was trying to add a progress bar to my Tkinter gui, and I have been stymied by a problem that I am not 100% sure how to define. My program is setup in this fassion.
class MAIN(object):
def __init__(self, *args, **kwargs)
tkinter stuff...
root = tk.Tk()
app = MAIN(root)
app.mainloop()
And then I tried to add a progress using this example (that works on its own). And this code is set up like this.
class MAIN(tk.Tk):
def __init__(self, *args, **kwargs)
tk.Tk.__init(self, *args, **kwargs)
tkinter stuff....
app = MAIN()
app.mainloop()
If I change either of these programs to have the other's format they throw errors. I would ideally like to be able to keep my format (the first one) and be able to run the example in my format, so that way I don't have to update a lot of legacy code.
Help/explanations will be greatly appreciated.
Edit: Here is the error.
TypeError: unbound method __init__() must be called with Tk instance as first argument (got SampleApp instance instead)