Curso de Programación en Python/Input-6

De WikiCabal
Saltar a: navegación, buscar

Input-6.py

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

from tkinter import ttk
import tkinter

root = tkinter.Tk()

style = ttk.Style()
style.layout( "TMenubutton", [
   ( "Menubutton.background", None ),
   ( "Menubutton.button", {"children":
       [( "Menubutton.focus", {"children":
           [( "Menubutton.padding", {"children":
               [( "Menubutton.label", {"side": "left", "expand": 1} )]
           } )]
       } )]
   } ),
] )

mbtn = ttk.Menubutton( text='Mucho Texto' )
mbtn.pack()
root.mainloop()

Resultado

Input-6.png