Tkinter Wiki   ExampleCompoundButton UserPreferences
 
HelpContents FindPage Diffs Info Edit Subscribe XML Print View

1. Compound Button Example

The new compound options for buttons, labels and menu's means we can now display both the text and image or bitmap at the same time.

An example of a compound button:

  1 
  2 
  3 
  4 
  5 
  6 
  7 
from Tkinter import *

root=Tk()
for comp in ("bottom", "center", "left", "none", "right", "top"):
    b = Button(root, compound=comp, text=comp, bitmap="error")
    b.pack()
root.mainloop()

compoundbutton.png

PythonPowered