Creating Image Maps

Steve Holden steve at
Fri Dec 24 15:21:50 CET 2004

Aaron wrote:

> I know this is a thing used primarily on websites..but since python can do
> anything ;)
> I'm trying to make a clickable image map for my wxPython program.
> Basically, I know how to organize the images into one large image in a
> panel, but how do I make the individual pieces clickable like webpage
> links(in wxPython)? The goal is to add an event handler that displays the
> image piece in a different panel, along with attributes. Which I could do
> if only I could make the pieces clickable
> Any ideas?
> Also, if you have any hard to find links on the general area I'm talking
> about, I'd like to learn as much as possible.
Basically, your approach can be completely different under wxPython - 
you can use a single image, and then query the mouse click events to 
determine which location (and therefore which portion of the image) was 

You *could* use separate images as well, in which case you would need to 
provide callback functions to be called for clicks on the various 

Take a look at the docs for wxEvent, and see if that leads you to 
something you can understand.

Steve Holden     
Python Web Programming
Holden Web LLC      +1 703 861 4237  +1 800 494 3119

More information about the Python-list mailing list