Ciao ho problemi su window 7
non mi cambia il colore  background ma rimane bianco come mai
in un pc dove ho cambiato il tema in window classico funziona ( e che cacchio )
segue l’esempio funzionante
Grazie Gian

import tkinter as tk
from tkinter import ttk
def Pressed():
    #print(CasellaTesto.cget('state')) SOLO PER DEBUG
    Stato=str(CasellaTesto.cget('state'))
    #print(Stato) SOLO PER DEBUG

    if Stato=='normal':
        CasellaTesto.config(state='readonly')
    else:
        CasellaTesto.config(state='normal')

Fin = tk.Tk()
ST = ttk.Style()
ST.configure('EntryStyle.TEntry', fieldbackground='yellow')
ST.map('EntryStyle.TEntry',fieldbackground=[('readonly','cyan')])
CasellaTesto = ttk.Entry(Fin, style='EntryStyle.TEntry')
CasellaTesto.grid(column=0, row=0)
But=ttk.Button(Fin,text='modifica',command=Pressed)
But.grid(column=0,row=1)
Fin.mainloop()

---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus
_______________________________________________
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python

Rispondere a