468,114 Members | 2,056 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,114 developers. It's quick & easy.

Change Tkinter Look and Feel?

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.

I tried configuring the the OptionMenu widget with the 'image' keyword
to be, but that only resulted in the image appearing next to the
default one for the button instead replacing it. Is the look of this
button hardcoded in the tk or tcl libraries themselves?

The Pmw module has the same problem since it's using the standard
Tkinter widgets internally.

Best regards,
-Martin
Jul 18 '05 #1
1 5317
mm*****@tx3.com (Martin) wrote in message news:<78**************************@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
Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by John Salerno | last post: by
reply views Thread by Kevin Walzer | last post: by
7 posts views Thread by krishnakant Mane | last post: by
44 posts views Thread by bg_ie | last post: by
4 posts views Thread by fabdeb | last post: by
5 posts views Thread by MartinRinehart | last post: by
7 posts views Thread by Protected | last post: by
3 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.