Subclassing Tkinter.Tcl Subclassing Tkinter.Tcl tkinter tkinter

Subclassing Tkinter.Tcl


If you look inside Tcl function, you can see an interesting flag used to create Tk instance

def Tcl(screenName=None, baseName=None, className='Tk', useTk=0):    return Tk(screenName, baseName, className, useTk)

Thus you can subclass Tk and inhibit Tk instantiation

class TclPlus(Tk):    def __init__(self):        Tk.__init__(self,useTk=0)tcl = TclPlus()tcl.eval("expr 6*7")