What's the most fail-proof way of dynamically fetching a widget
's internal Tcl/Tk class name?
try: # In order to be able to import tkinter for
import tkinter as tk # either in python 2 or in python 3
from tkinter import ttk
except:
import Tkinter as tk
import ttk
if __name__ == '__main__':
root = tk.Tk()
widget = ttk.Combobox(root) # Would be "TCombobox" in this case
widget.pack()
root.mainloop()
This is only base widget though, please consider deep inheriting classes of this widget
.