473,786 Members | 2,775 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Bitmaps On Buttons ?

I am slowly progressing with my python app.

I have got to the point where I would like to place images onto my buttons.
I use Tkinter as my GUI libary.

The following is how I understand I place an image onto a button - but I am
not having much success with it all.

Any ideas ?

Pete

b=Button(ToolBa r,padx=1,pady=1 ,width=2,height =1,command=call quit,)
b.bitmap="@butt on_cancel.xbm"
b.place(x=0,y=0 )

Jul 18 '05 #1
1 1848
PGMoscatt wrote:
I am slowly progressing with my python app.

I have got to the point where I would like to place images onto my buttons.
I use Tkinter as my GUI libary.

The following is how I understand I place an image onto a button - but I am
not having much success with it all.

Any ideas ?

Pete

b=Button(ToolBa r,padx=1,pady=1 ,width=2,height =1,command=call quit,)
b.bitmap="@butt on_cancel.xbm"
b.place(x=0,y=0 )


put the bitmap= inside the construction of the button widget like so:

b = Button(ToolBar, padx=1, pady=1, width=2, height=1, command=callqui t,
bitmap="@button _cancel.xbm")

BTW You shouldn't need to set the height and width - the button will
take it's size from the bitmap

BTW2 I notice you are using place geometry manager you may get a
'better' behaved GUI with the pack or grid geometry manager, it will
resize much better as widgets are pack'ed or grid'ed relative to each other

for more help you could try:

http://www.pythonware.com/library/tkinter/introduction/

or the Wiki that has links to other sources of help (including the
Tkinter mailing list

http://tkinter.unpythonic.net/wiki/FrontPage

Cheers
Martin


Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2222
by: Brad Smalling | last post by:
Does anyone know if there is a reason to prefer bitmaps over icons (or vice-versa) when populating image lists? I've always favored icons because of their built-in transparency (although I've never use the invert "color"). But I've noticed that Microsoft seems to favor bitmaps in many of their sample applications. Is there a reason? For instance, do icons clutter the icon cache or require more system resources whereas bitmaps do not? ...
4
4912
by: Sascha Kerschhofer | last post by:
Hello everyone, does somebody knows how I can extract Bitmaps from a Powerpoint file (one per slide)? I found some ressources which opens Powerpoint as application and controls it programmatically. But I am looking for a way to do this without the help of Powerpoint itself. Would I need a kind of a rendering engine for this file format? Or are kind of "thumbnails" embeded inside if such a file? Will the "Microsoft Power Point 9.0 Object...
1
2384
by: Mark Evans | last post by:
I have a dialog box and on it I want to display a bitmap, which will change at various times during the program. My problem is that the bitmaps will not be the same each time. I want the user to put their own bitmaps into a directory and the application will pick them off and display them as required. The bitmaps will always be called the same thing, ie 1.bmp, 2.bmp, 3.bmp - but they will be different pictures. I am new to visual...
13
1588
by: Flashster | last post by:
I want to create buttons in the shape of bitmaps - i.e. without a square around them. How would I do this? Thanks, Flash
2
5270
by: jgraham | last post by:
I have an application which configures the user interface (UI) at runtime, meaning, the images that make up the UI are loaded based on the current configuration when the application starts. The UI is populated with normal controls (buttons, lists, etc.) but some controls can load a bitmap to represent them. For instance, each button in the window loads a bitmap as it's BackgroundImage. Also, the BackgroundImage of each dialog is also...
2
2078
by: Mike | last post by:
Hello everybody. I am drawing a country map that consists of 149 municipality bitmaps, each around 25 Kb. I draw it onto the in-memory bitmap, then draw it on the picture box. I use C++, but anyways if I were using the C# the question would be the same. And here is the problem: it takes 700 ms to draw it, and anything above 300 ms is noticable by the human eye. So, is there any technique that I could use to actually keep the bitmaps in...
6
1522
by: Paul | last post by:
I am developing a VB.net tool that requires editing to be done. I would like to use the same standard bitmaps for my command buttons as MS Word uses. Are these available anywhere?
0
1097
by: BerkshireGuy | last post by:
Anywhere know where to get some free bitmaps to use as command buttons? I know Access has some, but I'd like a variety. Guess I could make some, but I'm not artistic :) Thanks
1
2732
by: nkumarin001 | last post by:
Hi, Can anyone help me in this matter:- When i was studying locally managed tablespaces i came across bitmaps that are used in locally managed tablespaces it stated that:- "Locally managed tablespaces use bitmaps stored within the header of the datafiles comprising a tablespace to track the space utilization of the tablespaces." AND When i was studying some other topics i came across...
0
9650
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10164
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8992
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6748
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.