Test tkinter

Il codice minimo per aprire una finestra con tkinter Esempio 1 from tkinter import * root=Tk() root.mainloop() Esempio 2 Con alias tk per il modulo import tkinter as tk root=tk.Tk() root.mainloop() Esempio 3 Test ufficiale di Tcl/Tk import tkinter tkinter._test() Esempio 4 Con alias tk per il modulo import tkinter as tk tk._test()

Riepilogo Tkinter

Proprietà background (bg) – Button command – Button font foreground (fg) from_ height justify – Label offvalue – Checkbutton onvalue – Checkbutton orient side sticky text – Button – Label – Radiobutton textvariable – BooleanVar – DoubleVar – IntVar  – StringVar – StringVar to value – Radiobutton variable – BooleanVar – DoubleVar – IntVar  – … Leggi tutto

Colori

alice blue – AliceBlueantique white – AntiqueWhite – AntiqueWhite1 – AntiqueWhite2 – AntiqueWhite3 – AntiqueWhite4aquaaquamarine – aquamarine1 – aquamarine2 – aquamarine3 – aquamarine4azure – azure1 – azure2 – azure3 – azure4beigebisque – bisque1 – bisque2 – bisque3 – bisque4blackblanched almond – BlanchedAlmondblue – blue1 – blue2 – blue3 – blue4blue violet – BlueVioletbrown – brown1 … Leggi tutto

…Var()

Una variabile di controllo è un contenitore per un valore logico, float, intero o stringa che può essere associato a uno o più oggetti grafici. BooleanVar() DoubleVar() IntVar() StringVar() Metodi x.get(), restituisce il valore di x x.set(v), imposta il valore di x Una variabile di controllo può essere associata a uno o più oggetti grafici tramite … Leggi tutto