473,385 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 6221
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Leo | last post by:
hi there for somebody who wants tostart small/medium GUI apps with python: what's the best toolkit: tkinter, wxPython or what? stability, ease of use and portability between mac and windows...
6
by: Dustan | last post by:
Nobody answered last time. I guess they wanted me to give it a shot. Well, here is how I download the image (it's a class method): def download_image(self):...
2
by: John Salerno | last post by:
I'm a little confused. I was under the impression (perhaps incorrectly) that Tkinter will create GUI widgets that are native to your OS, so I should have an XPish looking application. But when I...
0
by: Kevin Walzer | last post by:
Is anyone using Tile in their Tkinter applications? Tile provides native theming for Windows XP and Mac OS X, and provides an improved Tk look-and-feel on Unix/Linux. For info on Tile:...
7
by: krishnakant Mane | last post by:
hello all, I seam to have noticed this a bit late but it appears to me that tkinter is being used very widely for gui development on all platform? is that right? since fredric lundh has written a...
44
by: bg_ie | last post by:
Hi, I'm in the process of writing some code and noticed a strange problem while doing so. I'm working with PythonWin 210 built for Python 2.5. I noticed the problem for the last py file...
4
by: fabdeb | last post by:
Hi every one, I m a sysadmin who want to know how to use python. I dont know anything about oriented object programation, i only know bash and a little perl. I have some simple questions about...
5
by: MartinRinehart | last post by:
Tkinter gets no respect. But IDLE's a Tkinter-based app and every example I've Googled up shows Tkinter as needing about half as much code as wx to do the same job. I'm beginning to Tkinter up my...
7
by: Protected | last post by:
Hello. I'm a complete newbie trying to learn Python. I decided to try some Tkinter examples, including the one from the library reference, but they don't seem to do anything! Shouldn't there be,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.