[wxPython] [Q] wxBitmap

Message: 12
From: "Robin Dunn" <robin@alldunn.com>
To: <wxpython-users@lists.wxwindows.org>
Subject: Re: [wxPython] [Q] wxBitmap
Date: Wed, 14 Nov 2001 11:03:31 -0800
Reply-To: wxpython-users@lists.wxwindows.org

>
> I put "positive.gif" and the python script code in the same directory.

But

> it didn't work. I got "No ImageHandler for type 13 is defined" error
message
> with the above code. I guess, I need to something to use gif file.

As Cliff mentioned, you need to call wxInitAllImageHandlers sometime

during

your program's startup before loading images that are not BMP or XPM.

>
> After reading wxWindow online document, I came to know the image handler
for
> BMP is installed by default so I tried to use BMP instead of GIF as
follows:
> toolBar.AddSimpleTool( 10, wxBitmap( "positive.bmp",

wxBITMAP_TYPE_BMP ),

\
> "Positive", "Assign Positive Relation" )
> With this code, I don't have any error message, but I don't have tool

bar

> icon, either.

Is your image 16x15 pixels? If not did you call SetToolBitmapSize? Are

you

sure that the current working directory of your program is still the
directory where the image file is located? (If you are running the hybrid
version on Windows then you will get a warning message about being unable

to

find the file.) If not then specify a full path to the file.

I wanted to use 24x24 bmp file so I added
toolBar.SetToolBitmapSize( wxSize( 24, 24 ) )"
But it didn't still work, either.

As I said, I put everything in one directory, change the working directory
in windows2000 command tool to the directory in which I put them all, then
execute the script with "python MainWindow.py". But I still got an empty
tool bar.
Is there any sample script to create a tool bar with an external bmp or gif
file? I don't know what I did wrong.

Thanks in advance.

YJ

Is there any sample script to create a tool bar with an external bmp or

gif

file? I don't know what I did wrong.

wxPython/samples/pySketch/pySketch.py

ยทยทยท

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!