Creating Image Maps

Steve Holden steve at holdenweb.com
Fri Dec 24 09:21:50 EST 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 
clicked.

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 
sub-portions.

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

regards
  Steve
-- 
Steve Holden               http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/
Holden Web LLC      +1 703 861 4237  +1 800 494 3119



More information about the Python-list mailing list