472,950 Members | 2,395 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,950 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 6187
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,...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.