Curso de Programación en Python/Input-5

De WikiCabal
Saltar a: navegación, buscar

Input-5.py

#!/usr/bin/python3
#-*-coding: utf-8 -*-

import tkinter
from tkinter import ttk

root = tkinter.Tk()

style = ttk.Style()
style.map( "C.TButton",
    foreground=[('pressed', 'red'), ('active', 'blue')],
    background=[('pressed', '!disabled', 'black'), ('active', 'white')]
    )

colored_btn = ttk.Button( text="Prueba", style="C.TButton" ).pack()

root.mainloop()

Resultado

Input-5.png