Custom window different from the default in python

1

Hi, I would like a Python window example, other than the default one, how do I do this ???

This is my code:

from tkinter import = 
root = Tk()
theLabel = Label(root, text="This is too easy")
theLabel.pack()
root.mainloop()
    
asked by anonymous 16.02.2016 / 09:18

1 answer

1

I'm not sure I understand the difference, but you can change the windows theme to use native system elements (X11, Windows, etc.) with the command from ttk import * :

Example:

Without ttk :

Withttk:

Examplegeneratedwith:

fromTkinterimport*fromttkimport*#bastaacrescentarouretirarestalinharoot=Tk()Frame(root)if(rootisnotNone):root.title("Teste")
    theLabel = Label(root, text="This is too easy")
    theLabel.pack(fill='both')
    sair = Button(root, text="Sair", command=quit)
    sair["state"] = "normal"
    sair.pack(fill='both')
    root.mainloop()
    
16.02.2016 / 10:09