Change Tkinter Look and Feel?

klappnase klappnase at web.de
Sat Jul 17 11:40:20 EDT 2004


mmiller at tx3.com (Martin) wrote in message news:<78c1b378.0407170147.36a455de at posting.google.com>...
> Anybody know how to change the menu button that is displayed by the
> Tkinter Menubutton and the (derived from it) OptionMenu classes? I
> think it must be something from the Motif look and feel which doesn't
> fit with my appl which is designed primarily for running on Windows
> and OS X.
> 
> The default button visual that appears is basically a small rectangle
> drawn in relief inside a larger one. I'd like to replace this with a
> downward pointing arrow to indicate the drop-down menu.
> 

If you run Tk8.4 you can use the compound option, that allows to
display both text and images in a widget:

o = OptionMenu(master, var, 'item1', 'item2')
o.configure(indicatoron=0, compound='right', image=arrow)

where arrow is a Tkinter.PhotoImage or BitmapImage instance with the
arrow icon you want. Setting indicatoron to 0 makes the default "motif
style" rectangle disappear.

I hope this helps

Michael



More information about the Python-list mailing list