Curso de Programación en Python/Input-5
Ir a la navegación
Ir a la búsqueda
Input-5.py
1 #!/usr/bin/python3
2 #-*-coding: utf-8 -*-
3
4 import tkinter
5 from tkinter import ttk
6
7 root = tkinter.Tk()
8
9 style = ttk.Style()
10 style.map( "C.TButton",
11 foreground=[('pressed', 'red'), ('active', 'blue')],
12 background=[('pressed', '!disabled', 'black'), ('active', 'white')]
13 )
14
15 colored_btn = ttk.Button( text="Prueba", style="C.TButton" ).pack()
16
17 root.mainloop()